# Learning Java



## abhisheknaik96 (Jun 13, 2013)

Hey everybody, I wanna learn Java from scratch. I found some Ebooks on the net-
Learn Java/Java 6/Java 7 etc in 21 days(all are different books)
Should I start the Java 7(latest book), or is their some hierarchy? 
I mean, do I have to read the previous versions? i.e. Is Java 7 different from Java 6  n so on?
Is it OK to start the Java 7 book?
Thanks.


----------



## krishnandu.sarkar (Jun 13, 2013)

No. You don't need to learn Java 6 to learn Java 7 neither you need to do that.

Things are almost identical, with performance and other security fixed. Syntax doesn't change much.


----------



## rhitwick (Jun 13, 2013)

Dude, my advice would be this,
Buy "The Complete Reference : JAVA" by "Herbert Schildt" and read from preface to chapter 10 (Threading if that is its still organized)

Read each word and practice every damn program.


----------



## Desmond (Jun 13, 2013)

It is ok to start from the Java 7 book but also have a reference book handy to know what's been deprecated in Java 7 so that you avoid using those methods.

You don't need to learn Java 6 or 5 unless you are working on something that needs to be backwards compatible.


----------



## abhisheknaik96 (Jun 13, 2013)

Thanks a lot everybody!


----------



## deadcode00 (Jun 13, 2013)

I will say search for videos of newboston in youtube.. You will learn quickly trust me...


----------



## vickybat (Jun 13, 2013)

New boston is great, especially bucky roberts. 

But the java tutorials, although good are a bit dull compared to his other tutorials. 
But they are highly informative and concise nonetheless.


----------



## deadcode00 (Jun 13, 2013)

Actually i like the way he explain things .. Its easy to understand.. Very good for newbie .. I also followed his tutorials and thats really helped me to understand java..


----------



## vickybat (Jun 13, 2013)

deadcode00 said:


> Actually i like the way he explain things .. Its easy to understand.. Very good for newbie .. I also followed his tutorials and thats really helped me to understand java..



Actually i meant something else. See, i've followed his xhtml, html5, javascript and mysql tutorials and finished them too. In all of these, he cracks humorous jokes in between to lighten up the mood, and his tone is light and jovial. The funniest way to learn some serious subjects and that too by practical viewing.

But in the java tutorials,he sounds serious and rarely cracks a joke, almost through all the chapters. Its not like he's half hearted and all , but maybe java is a more serious and hardcore topic.


----------



## deadcode00 (Jun 13, 2013)

Yup hes really humours but intelligent too.. But your right may be java aint that fun to teach


----------



## harshilsharma63 (Jun 13, 2013)

rhitwick said:


> Dude, my advice would be this,
> Buy "The Complete Reference : JAVA" by "Herbert Schildt" and read from preface to chapter 10 (Threading if that is its still organized)
> 
> Read each word and practice every damn program.


+1 for this.


----------



## kg11sgbg (Jun 13, 2013)

Another great site is *Udacity*.(Link :--->   www.udacity.com)
In there,hands on practical goes side by side with learning.
A very good modular approach.
OP could also try for that,though newboston is GREAT.


----------



## vickybat (Jun 14, 2013)

kg11sgbg said:


> Another great site is *Udacity*.(Link :--->   www.udacity.com)
> In there,hands on practical goes side by side with learning.
> A very good modular approach.
> OP could also try for that,though newboston is GREAT.



+1 for Udacity. I almost forgot to mention this.



rhitwick said:


> Dude, my advice would be this,
> Buy "The Complete Reference : JAVA" by "Herbert Schildt" and read from preface to chapter 10 (Threading if that is its still organized)
> 
> Read each word and practice every damn program.



Buddy, complete reference series is not for learning from scratch. Its a reference book. 
Guys who are familiar with java syntax and methods will benefit from it. For complete newbies, there are better options like head first java and the above mentioned tutorials.


----------



## deadcode00 (Jun 14, 2013)

vickybat said:


> +1 for Udacity. I almost forgot to mention this.
> 
> 
> 
> ...



+1 for head first java...


----------



## Desmond (Jun 14, 2013)

deadcode00 said:


> +1 for head first java...



Head first Java is the best and the most easiest book to learn from scratch. Its not very cheap though.


----------



## rhitwick (Jun 14, 2013)

vickybat said:


> Buddy, complete reference series is not for learning from scratch. Its a reference book.
> Guys who are familiar with java syntax and methods will benefit from it. For complete newbies, there are better options like head first java and the above mentioned tutorials.


When I was in college I taught myself JAVA by that book. Yes, it helps if you have programming background but its obviously a good book. Don't ignore it because it has "Reference" in its name.


----------



## abhisheknaik96 (Jun 14, 2013)

Yeah, another thing...
I just downloaded and installed JDK 7 from the Oracle website. Now which application in which folder of that should I open to make Java programs? There is a 'java' application in the 'bin' folder, but when I open it, a DOS-like environmentopens for a second n then closes.
Please help.
Thanks.


----------



## deadcode00 (Jun 14, 2013)

abhisheknaik96 said:


> Yeah, another thing...
> I just downloaded and installed JDK 7 from the Oracle website. Now which application in which folder of that should I open to make Java programs? There is a 'java' application in the 'bin' folder, but when I open it, a DOS-like environmentopens for a second n then closes.
> Please help.
> Thanks.



Why dont you try eclipse.. Download and install it, and start programming


----------



## harshilsharma63 (Jun 14, 2013)

abhisheknaik96 said:


> Yeah, another thing...
> I just downloaded and installed JDK 7 from the Oracle website. Now which application in which folder of that should I open to make Java programs? There is a 'java' application in the 'bin' folder, but when I open it, a DOS-like environmentopens for a second n then closes.
> Please help.
> Thanks.



You cannot develop Java apps with JDK alone, you also need an IDE. NetBeans is the most popular IDE for Java (and is developed by Oracle themselves). Download it, install it and you'll be redy to develop Java applications on it. There are step-by-step instructions available on Oracle's website on getting started with netbeans.


----------



## Desmond (Jun 14, 2013)

It is not necessary to have an IDE to code in Java. You can do it in notepad as well. And I recommend that you start out with notepad so that you understand how the compilation process takes place. Once you understand this, then move on to using IDEs.


----------



## rhitwick (Jun 14, 2013)

abhisheknaik96 said:


> Yeah, another thing...
> I just downloaded and installed JDK 7 from the Oracle website. Now which application in which folder of that should I open to make Java programs? There is a 'java' application in the 'bin' folder, but when I open it, a DOS-like environmentopens for a second n then closes.
> Please help.
> Thanks.


All the books you have acquired till now...have you even opened 'em a bit? Every beginner book has clear cut explanation on how to program, compile and execute the programs. READ THE BOOK.


----------



## Desmond (Jun 15, 2013)

abhisheknaik96 said:


> Yeah, another thing...
> I just downloaded and installed JDK 7 from the Oracle website. Now which application in which folder of that should I open to make Java programs? There is a 'java' application in the 'bin' folder, but when I open it, a DOS-like environmentopens for a second n then closes.
> Please help.
> Thanks.



You write code in Notepad, then open the command prompt, go to the path where the code is saved and type "javac <filename>" after the source code is compiled, you will find a .class file in the same folder, now type "java <classname>". Your code will execute.

To get you started, open Notepad and type the following : 


```
class Hello{
  public static void main(String[] args){
    System.out.println("Hello world");
  }
}
```

Save this file as Hello.java.

Now open the command prompt and go to the path where you saved the file. Now type "javac Hello.java" and press enter. If everything went well, you will get back the command prompt without any additional messages. Then type "java Hello" and press enter. You should see "Hello world" printed on the screen.

This is how you write simple java code. I strongly suggest that you learn all the fundamental concepts this way so that you are familiar with the way the Java compiler functions.


----------



## JGuru (Aug 3, 2013)

Use a good editor like *TextPad* (TextPad - the text editor for Windows) It has lot of good features like line numbers, syntax highlighting, compile & run etc.,
It's absolutely free!!! Notepad is a very primitive tool!! It's also very easy to use for newbies.


----------



## akshaykapoor_3 (Aug 3, 2013)

abhisheknaik96 said:


> Hey everybody, I wanna learn Java from scratch. I found some Ebooks on the net-
> Learn Java/Java 6/Java 7 etc in 21 days(all are different books)
> Should I start the Java 7(latest book), or is their some hierarchy?
> I mean, do I have to read the previous versions? i.e. Is Java 7 different from Java 6  n so on?
> ...



Abhishek,

How old are you.?? You want to learn Java just for knowledge sake or are you already into computer studies and willing to take up some IT job pretty soon..?? 

Presently, I am working as a Software Developer Java with a company from the last 2 years. Believe me, working in the industry brings altogether a different approach to programming and often initial months of every fresher are used up getting adapted to the protocol followed in a professional environment which is altogether different from how,what,why we program in college or school.

Anyways, I would recommend Cay HorstMann and Gary Cornells Core Java and Advanced Java for you. With this you will get a deep insight into Java and how it works and will help you build up a strong base with the language.

Secondly, with Java 7 you will only find something added up to the previous versions so no harm starting up straightaway with the newer version. It's not that Java 7 works differently than 6 etc.

Use Eclipse IDE for writing and running the code.

Good Luck !


----------



## zeeshanaayan07 (Aug 11, 2013)

Please share a link to learn java


----------



## ashleyfiore (Aug 30, 2013)

I think "Head First - Series - O'Reilly Media" is the best java book .


----------



## avinandan012 (Aug 30, 2013)

Answer these :
1. Do you have any prior programming experience in any programming language?
2. Are you able to run that hello world program ??


----------



## prehistoricgamer (Oct 4, 2013)

First of all, if you are learning a programming language, DO NOT BLOODY USE AN IDE. Use it only when you've had a decent grasp on the subject/content of the language.
AN IDE will complete most of the tasks for you and you wont learn a god damn thing. I suggest you to use simple text editors with syntax highlighting like Notepad++ or even Sublime Text 2. Both are free.

And as far as which IDE to use, there's whole lot of debate to that topic it self as its more of a personal choice. But you'd find Eclipse to be more user friendly and visually pleasing.

Second off, you just cannot compile java source using "java" from cmd. You will have to include its path in the PATH variable in your environment settings on Windows.

Thirdly, If you do not want to purchase any book or scroll through ebook pdf's, I suggest you to download the Official Java docs from Oracle site. They have their own tutorials with examples. That's where I started. Sun Tutorials + Java Docs = Best reliable source as it directly comes from them and you also have all the necessary information you'd ever need about the language (classes, methods, interfaces etc.) right there on your system as offline content. The best part about this approach is, if you want to check out any particular class, just search that in Windows Start. example, you want to search for documentation of Strings. Simple click Start, type Strings.html.

There. You will have the page. (Provided you've included the docs & tutorial folders in your Windows Search Index). This was the way I learned and it was pretty beneficial.


----------



## sksundram (Oct 5, 2013)

^^ +1.....


----------



## vickybat (Oct 5, 2013)

First of all i want to recommend "blue-j" IDE for educational purposes. Its build that way and does not try to correct the syntax on its own. You just get a plain and simple compiler error and have to figure out the errors yourself by conventional syntax checking or debugging.

Blue-J is very popular even in universities worldwide and used by many computer scientists to teach young programmers. I suggest Op to consider blue-j. Compiling using cmd is real pain and unnecessary.


----------



## avinandan012 (Oct 9, 2013)

+1 to vicky.
The purpose advising cmd to a modern day java beginner is to face syntax errors & others .But I feel it's a waste of time try to do things in cmd, so an IDE like blue-j is very good in that aspect.


----------

