CodeGym /Courses /Java Multithreading /Learning to google. I'll show you how to search for a sol...

Learning to google. I'll show you how to search for a solution to a specific problem

Java Multithreading
Level 1 , Lesson 12
Available

"Hi, Amigo!"

"I can teach you my special skill: avoiding unnecessary work."

"Hmm. I like how this is starting."

"Remember, it's impossible to know everything. And it's not necessary. But, if you can quickly find the information you need, then you're golden."

"Java is growing so quickly, because Java programmers use each other's work. The Internet has millions of Java libraries that are well written, debugged, documented, and license free. Use them."

"There are hundreds of websites for programmers, where more experienced programmers help beginners and those who are less experienced. Use them."

"Anything you may want to write, somebody else has already written. Well, maybe not everything, but 90-95 percent, for sure."

"Whoa."

"I want you to always remember two things:"

1. Programming started over 50 years ago. Java is almost 20 years old.

99% of the code you need has already been written.

2. Before you write anything from scratch, search the Internet. Most likely, someone has needed it before and already solved the problem.

"So, we're going to learn how to 'google', i.e. search the Internet. As you might have guessed, 'googling' involves using the Google search engine."

"Other search engines will work too. But because programming is evolving most rapidly in Silicon Valley, Google will be our tool of choice."

"I will give you tasks where you need to find something using Google, so you'll have to learn how to search for things."

"But for now, we'll just start with some examples."

What we want to know Google query Note
In Java, how do I check whether a file exists? java file exists The very first link has the answer.
Answer:
File f = new File(filePathString);
if(f.exists())
{ /* do something */ }
In Java, how do I download a file from the Internet? java file download The very first link has an example.
Answer:
URL website = new URL("http://www.website.com/information.asp");
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream("information.html");
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
How much is $100 in rubles? 100 dollar in RUB You don't even need to click a link for this answer!
Answer:
3 270.21812 Russian rubles
How do I figure out which JDK version is installed? how to get jdk version The second link.
Answer:
C:\>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

"Don't be lazy. Go to Google, enter those queries, and find the answers."

"We're learning how to find answers in seconds rather than hours, and sometimes weeks. Which can happen."

"Wow. I promise I won't be lazy."

"An experienced developer can use the Internet to find an answer or a clue for 99.99% of all problems that may arise."

"Whoa!" I'm going to always listen carefully to what you have to say!"

Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Ivaylo Trifonov Level 25, Madrid, Spain
7 August 2024
Some time ago, in 2018, I took an Android course from Google. There was a tips-based lesson and a group of very experienced senior developers gave us advice. I remember one of them saying that he doesn't know much about Java, it is impossible to know everything about the programming. He uses Google in his day-to-day work. Obviously, it was a Google advertisement, but the point is that we (the juniors) try to remember everything and when we start a project on our own we get upset very quickly and say: "Man, I just don't know how to do this part. I think that the programming is just not for me... :(".
阿狼 Level 32, Zhengzhou, China
2 July 2022
《论如何成为一个经验丰富的CV程序员》 🤡
Ewerton Level 30, Belo Horizonte, Brasil
10 July 2019
This article was probably written in June-July 2012, based on RUB price :)
Agent Smith Level 38
24 September 2020
Yea, it seems you are right. 7,692.12 as of September 2020.
Azja Level 32, Krakow, Poland
9 May 2019
I like 4th line where you said that we don't have to(and IMO we shouldn't try) know everything. If some tasks is too hard just go ahead(but not too often) or google it like in this lecture