• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to learn Java?  RSS feed

 
Jack Lickman
Greenhorn
Posts: 2
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I guess there was like a thousands of these topics, but I hope you will help me out anyway. I started having an interest in Java like couple days ago and I was going through some video tutorials on youtube and ebooks I found on internet. I've never been learning any other programming language before so Java is my first one. Problem is I got so confused lately in Java and I have no idea on how to learn this language. Let me first tell you what my goals are. Well, I'd like to create some simple 2D games in future and get a well-paid job as Java Developer. For now these goals are like impossible, I can't set a learning way. So I was learning recently about syntax (generally), data types, conditions, loops, arrays, stuff like that. I don't know how to proceed further to be closer achieveing my goals. I told to myself today this: "So I want to create a simple 2d game, then what skills do I need?" I watched tutorial on game development and quickly I freaked out. I didn't understand pretty much nothing and I was only copying blindly code, just to see a graphical window, instead of text console when I was learning about math operators and loops stuff. I panicked, it was too hard. So right now it is hard for me to set proper direction in learning java. Should I learn about GUI? Should I learn about Threads? Or something else? As I was quickly looking through some ebook, I realised 90% stuff is made in this boring text console. It's clear I don't have a computer programming mind yet and I don't know to merge all the subjects in books to create some interesting projects. So maybe you guys can share your ways for effective learning java, proceeding fast and not getting lost in this Java world.
 
Matthew Joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a noob too. It can be pretty overwhelming, I know. Its also hard to stay focused and positive when its all in the text console... But thats the part you need to learn first. pick something tiny, and see if you can get it to work. i am trying to make a java program that does console commands i use at work all the time. its not sexy, i know, but it has been teaching me a whole lot. everytime i get something to work correctly, i find three things that don't. then i scour the web for tips, and post on here. these people have been pretty helpful. the last couple of weeks i have learned object oriented programming, input/output streams, file writers, buffered input/output, and now i am moving to sockets. after i get the mechanics worked out, then i will start on a gui. loops, if statements, etc, are all important. but its just the tip of a huge frikking iceburg! It is going to be a long road to gaming. for me the key is to find a small, doable program that will keep my interest and teach me another aspect of the language.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Holden Caufield wrote: I realised 90% stuff is made in this boring text console.


I would say that the majority of programming has nothing to do with a GUI (or the text console). In a game, do you really think that the programmer spends the majority of the time drawing the image on the screen?

Do you think the folks at EA was manipulating a GUI (say calling in an AC-130 gunship) when working with "Call of Duty", for the majority of the time? Or do you think that the majority of the time (months and months of it) was spent using the "boring text console" to print out debugging messages, to see if the game engine is correct?

Henry
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't do this: You'll just get discouraged.

Heed Henry's advice and start with the fundamentals. It may seem boring at first, but everything else builds on those fundamentals. Unless you master them, then you will always find yourself just copying code without understanding what it does. And you never want this to happen. If you don't understand a code example, you must back up to fundamentals to understand it before you can use it.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nobody becomes an expert programmer in a few weeks or months. You wouldn't say "I'm going to become a guitar vituoso so I can make lots of money" and expect to be there by October. It literally takes years of practice, learning, trial-and-error, frustration, and yes, sometimes my fingers bleed when I program (stress and biting my nails...).

Is it worth it? that depends on each individual. I personally LOVE what I'm doing now, but it took me close to 15 years of full time work to get here.

I"m not trying to discourage you...I'm just trying to set the proper expectations.
 
Jack Lickman
Greenhorn
Posts: 2
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for replies. Yeah, I got the throwing yourself on deep water reference . I understand I have to start from fundamentals but I'm looking for a way to practice Java and proceeding further. The books chapters are very similar to themselves. They describe one topic, throw some code and then the next chapter begins. And you're wondering what to do. Should I think of creating assignments for myself? Or re-reading chapter multiple times? Or reading on this somewhere else, from different perspective?

I know I have to cool down about making big projects right now. I read my first post again and I guess what you may thought about me is: "Omg, this guy is in a hurry". Well, maybe. It was always a problem for me when I have started some new hobby, activity, I just wanted to master it in no time instead of enjoying baby steps. I need to cool down, I need to cool down. Definitely. I hope you can give me some clue how long stick to one chapter of book or video tutorial, how to practice what Ive learned, how to merge new topics, how to direct my mind to programming thinking etc.

And I forgot to say hello, so :

I hope to stay longer here and learn something!

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

As you discovered there is a huge world behind programming in Java. Even the most experienced experts don't know every possible library and framework. Take it slow, take your time to first learn the basics of the language, before thinking about bigger projects. Experimenting is a great way to learn - write lots of small programs to learn about all the features of the language. Oracle has a good set of tutorials, ranging from absolute beginner level to advanced subjects. There are also many books available.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First Java is an often recommended book for learning Java from the fundamentals on up.
 
W Akram
Greenhorn
Posts: 4
Eclipse IDE Java Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I've started learning Java a few weeks ago too. I thought I had some advantage having done some coding but in a procedural top-down style. But with OO concepts and Java it accounted for little apart from being familiar with basic structures ( if..then.else, for loops, while loops etc ). The second thing which bamboozled me when looking at what to download is the sheer plethora of things with Java stuck on the front, Java Beans, Jave EE, Java SE, Java DK, Java DE, JavaScript, etc. etc. that it makes one head spin.

I would concur with most of the comments posted thus far. There's an awful lot to take in with both the OO concepts and then with the syntax and programming language itself. Finally, as no doubt you are discovering as well, you will need to become familiar with key libraries. Personally, it is the libraries themselves that I find most difficult to get to grips with; a) which library I should be using in the first place; b) knowing how all the classes and methods work with each other within the library.

So I think the key take aways thus far ( for me anyway );

a) it's going to take time ( a lot of time )
b) grasping the core fundamentals of OO is vital
c) Give youself small programming tasks to do( Have you tried the JavaRanch ones? ). This stops me mindlessly copying examples from books/screens.
d) A good Java book is vital bedtime reading. I have Core Java 2, Volume I by Horstmann and Cornell published 1999! Sure it misses a lot of the new introductions to the Java language but I found it very good at explaining both the language and the OO concepts. At work I now realise programmers who claim they know OO don't really because everything is public static in their code!
e) Thank your lucky stars that the internet and forums like this are around!
f) Keep at it.


 
W Akram
Greenhorn
Posts: 4
Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention on my post, forget about games programming or graphics for the time being. I know games sound cool but when you are just starting out, it is too complex a task. Basics first and then the bigger stuff. E.g. Can you use the Calendar library to print out tomorrow's date in the format dd-mm-yyyy. Just the dd-mm-yyyy bit. Not the standard function that prints out everything.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, W Akram.

Good set of first posts!
 
Edwin Torres
Ranch Hand
Posts: 57
Java Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Lickman wrote:So I guess there was like a thousands of these topics, but I hope you will help me out anyway...


There are a lot of free online resources for learning Java. I write about them in my blog (shameless plug below). You can start by looking at the tutorials at Oracle. The Getting Started trail is a good one. But if you are new to programming, you might want to learn some basic programming concepts first. Codecademy has a good interactive, web-based learning tool. The Python tutorial teaches basic programming concepts (input, output, decisions, loops, etc.). You'll learn a little Python too. Learning the basic concepts will help you learn any programming language.

Then, and most important, practice writing lots of programs. You will learn something from every program you write, no matter how small. Malcolm Gladwell said it takes 10,000 hours of practice to become an expert at something. I can tell you that when I hit that mark in programming, my understanding was far above it was in the first hour. Practice a lot.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Lickman wrote:Thanks guys for replies. Yeah, I got the throwing yourself on deep water reference . I understand I have to start from fundamentals but I'm looking for a way to practice Java and proceeding further. The books chapters are very similar to themselves.

First: Welcome to JavaRanch, Jack.

Second: Which "books" are you using? My advice would be to stick to one (for the moment) and, as already stated, HFJ has a pretty good reputation.

Third: Like pretty much everybody else, I'd say you need to learn to walk before you run. Games are generally quite complex, and GUI code in particular is fiddly, verbose, and error-prone. I've been at this lark for over 35 years and I still loathe it.

Fourth: Read THIS. I don't want to discourage you, but it's an excellent article that hopefully explains that you're embarking on a long journey, and includes lots of tips on how to proceed.

Fifth: (a tip) Learn to be precise, and COMPILE OFTEN. Java is case-sensitive, so long is not the same thing as Long; and the compiler is not forgiving about things like spelling mistakes, or missing braces, or unmatched brackets. My rule of thumb is to compile every 10 lines I write and, as I say, I've been at this a long time.

Sixth: Whatever you do, make sure you ENJOY it. Programming isn't for everyone and, as I say, you're in for a long haul, so take it in small steps. That said, there can be huge satisfaction in getting even a simple program to run and see the results.

And if you run into trouble? Come back and ask for help. It's what we're here for.

You might also be interested in some of my articles (linked in my signature). They're mostly aimed at beginners, and I wrote them for stuff that crops up a lot on these forums.

HIH

Winston
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote: . . . long is not the same thing as Long; and the compiler is not forgiving . . .
It is even less forgiving about the difference between long and Long; it is liable to believe you whichever you write, whether you meant to or no.
 
Sooraj Rajagopalan
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing significant. Still i thought i'd simply mention. I knew a little bit of C programming fundamentals. And when i moved on to java, i was told to work on a CSV processor. A simple "Hello World" to begin with, apparently was not enough. my Guide made sure i wasn't simply copying codes from the internet and i had to submit a report and take a class on what each statement does. took me a week to realize that a simple Resource bundle could help locate properties files while using tomcat server.
 
Tiberius Marius
Ranch Hand
Posts: 115
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack Lickman wrote:So I guess there was like a thousands of these topics, but I hope you will help me out anyway. I started having an interest in Java like couple days ago and I was going through some video tutorials on youtube and ebooks I found on internet. I've never been learning any other programming language before so Java is my first one. Problem is I got so confused lately in Java and I have no idea on how to learn this language. Let me first tell you what my goals are. Well, I'd like to create some simple 2D games in future and get a well-paid job as Java Developer. For now these goals are like impossible, I can't set a learning way. So I was learning recently about syntax (generally), data types, conditions, loops, arrays, stuff like that. I don't know how to proceed further to be closer achieveing my goals. I told to myself today this: "So I want to create a simple 2d game, then what skills do I need?" I watched tutorial on game development and quickly I freaked out. I didn't understand pretty much nothing and I was only copying blindly code, just to see a graphical window, instead of text console when I was learning about math operators and loops stuff. I panicked, it was too hard. So right now it is hard for me to set proper direction in learning java. Should I learn about GUI? Should I learn about Threads? Or something else? As I was quickly looking through some ebook, I realised 90% stuff is made in this boring text console. It's clear I don't have a computer programming mind yet and I don't know to merge all the subjects in books to create some interesting projects. So maybe you guys can share your ways for effective learning java, proceeding fast and not getting lost in this Java world.




It's important to have the right expectations and to be ready to work to achieve something or you ll end up disappointed/disillusioned along the way and end up quitting . To learn java to a level you can go to an interview and with some luck get a junior developer position i think you need between 1200 - 1500 hours of structured study and practice at the list (if you start from absolute no programming knowledge ) That is about 10 months of 5 hour a day study every day of the month. You have to learn the basics then understand very well the OOP topics before moving to more advanced stuff like patterns etc and along the way also develop the problem solving skills that are essential apart from your understanding of the java language . I think it 's critically important to break down your goal in smaller ones where you can see the light at the end of the tunnel and know it's achievable (remember , if you can not justify the effort to yourself and know you can achieve it in your time scale you ll most likely quit along the way). Having the goal of so big as you have from your current level is monumentally difficult to envision you can achieve or believe you can achieve and it might not be the best way to motivate yourself to put the time and effort in to slowly getting there . This is my opinion trough i am not even half the level of someone like a junior java developer so i may be wrong with my estimations.

I have some experience with it as i started learning programming/Java from 0 almost 5 months ago but not with a goal of becoming a java developer but because that i think it's important to know a programming language no matter what your position is in IT ( be it designer , QA , project manager or even something like a HR person).

As a book that you can use as a framework and it the best validation/verification book about learning java i have found is : Intro into Java Programming tenth edition ( validation/verification is very good in motivating yourself and also having fun in my opinion)
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sooraj Rajagopalan wrote: . . . I knew a little bit of C programming fundamentals. . . .
C is a procedural language and Java® an object language. Many people find it very difficult to move from procedural programming to object‑oriented programming. It is learning the new paradigm that is the hard part.
 
Sooraj Rajagopalan
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is learning the new paradigm that is the hard part.


As to learning the new paradigm, i'm still finding it hard. its been a 2 months now..
 
Alice Hampton
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try Udemy if you can - its free to join,offers free java courses (I currently use a few) and discounted Java courses for as little as $10. They all have a lot of people using them and are all highly rated with interaction from the lecturer and interactive quizzes + downloadable content
 
Sooraj Rajagopalan
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alice Hampton wrote:I would try Udemy if you can - its free to join,offers free java courses (I currently use a few) and discounted Java courses for as little as $10. They all have a lot of people using them and are all highly rated with interaction from the lecturer and interactive quizzes + downloadable content


udemy is really good, yes.. Particularly javascript and ajax..
 
John Morgan
Ranch Foreman
Posts: 78
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I jumped into Java programming about a year ago. I had been on lots of sites (gettng snippets, doing tutorials etc) and it was not until I stumbled across this site where I finally found what I was looking for. So basically I was told to start learning Java for my new job. Okay I said I have over 25 years of computer experience, lots of HTML and HTML5 experience, lots of networking as well as PC support... I can do this.... then I dove in.... it is kind of like jumping off a diving board into the deep end for the first time... it is really daunting but once you are in it is fun. So here is my take from my whole year of trial and error.

1) Get Head First Java and Just Java 2 (http://www.amazon.com/Head-First-Java-2nd-Edition/dp/0596009208/ref=pd_bxgy_b_img_z and http://www.amazon.com/exec/obidos/tg/detail/-/0131482114/jr_cd-20) [sorry I do not know how to add URL links here yet]
2) Go through the tutorial in HFJ at the same time do the JavaRanch Cattle Drive here (it helped me solidify what I was learning)
3) Ask questions, by far this has been the best message base to ask questions for beginners... not once was I told or made to feel like a complete and total noob (even though I am)
4) Play with the tutorials... make them a little bit more complex than the basic... i.e. instead of counting from 1 to 10, count to 200 by 10s or 300 by 6s or whatever... change it up a little to see what code does.
5) Try to fix your mistakes on your own before asking for help (i.e. searching the net for an answer) the best way to learn is by doing, and making mistakes, then fixing them... besides there is a sense of pride when you do actually figure out that a != b all the time... but when it does....oooh boy.
6) Walk away.... if you get to the frustration point where it no longer becomes fun... take a break from programming or at least programming whatever was causing you the frustration.

Like I said it is just my 2 cents worth so take it for what it is worth.

(oh and if you can help people out here please do.... that also gives a sense of .... well pride that you finally know "something")
 
Paramvir Phagura
Greenhorn
Posts: 7
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't suggest you dive right into a high-level OOP language so fast. I'd say you should first learn Python, its a simple language yet very powerful. It'll give you a basic understanding of classes, objects, and data types.

However to answer your question, you can learn from "The Java Tutorials" provided by Oracle (http://docs.oracle.com/javase/tutorial/). Its the official Java documentation.
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is wrong with starting with Java®? Why do you suggest starting with Python? Programming is difficult and the difficulty is largely independent of the language used.

And welcome to the Ranch
 
Paramvir Phagura
Greenhorn
Posts: 7
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:What is wrong with starting with Java®? Why do you suggest starting with Python? Programming is difficult and the difficulty is largely independent of the language used.

And welcome to the Ranch


Theres nothing wrong with Java, I'm simply giving my opinion as I have experience. Python is a simple language to learn yet very powerful and you can write a Python application 3-5 times more faster than one written in Java. Plus, you can create Python scripts that can be interpreted by a Java application. And by the way, programming isn't difficult, it's just how you see it as difficult.

https://www.python.org/doc/essays/comparisons/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!