The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Some questions related to learning Java

Hi,
I am a very new learner here. I hope you people can share your ideas with me.
At the moment, I know a little about Java. Variables, arrays, operators, statements etc. I am investigating about classes at the moment.

Now questions:
1-Can I not make practices for now? I have very limited knowledge. To tell the truth, I don't have the knowledge to develop a console calculator (My book and videos did not mention how to get data from the user). But you need to practice in order not to forget what you learnt. So, what to do at this point? I don't feel confident to proceed. I mean I feel like I am forgetting what I learnt because of lacking practice.

Re: Some questions related to learning Java

Thank you for your answer. So, this is the answer for question 3 And answer to the second partly.

But how about the first one? At the moment, my codes like this: "Define an int variable. Put it into a loop or something. Then print something else.
At this point, I just can't find proper 'exercise' to apply what I learnt so far.

Just copy and paste this into a class (call it whatever you like) and call the getUserInput method whenever you need user input. Don't try to understand the code yet. Just use it. I am somewhat of a java noob too. I don't even fully understand that code, but it can be applied to most fundamental situations regarding user input.

When you need it, do this: (let's assume you named the class for it "UserInput")

[CODE]// Create a new object (with reference variable "user") for the input reader class.
UserInput user =new UserInput();// Call the UserInput object's getUserInput method.String userInput = user.getUserInput("Your message here");// The user input has been assigned to the String "userInput"// The rest of your code follows. Do what you need with this user input.// Example:if(userInput.equals("Dog")){System.out.println("Here is your new dog.");// Or make the userInput an integer (say they were supposed to enter a number)int input =Integer.parseInt(userInput);[/CODE]

Just use this if you want to get user input at the command line.

Now for your other questions.

Hold off on learning GUIs. I haven't even learned it yet! It's something that needs to come after you have mastered the skills of dealing with variables, understanding objects, classes, methods (how to call them), inheritance, and other things.

I HIGHLY recommend getting the book Head First Java if you haven't already.

It is a well-paced, well-explained book that will REALLY help you as a newcomer to Java.

Re: Some questions related to learning Java

I think I can understand some parts of the input code. And as I learn more later, I will understand it better and maybe code my own. Thanks for that.

I cannot find the book, because I am not a native speaker and I don't live where it is sold
Today, I took a look at the Oracle's Java tutorials. And I think I can combine it with my present references and maybe find one or two more. I should take notes and I feel like it will be just okay. The rest is up to my ability to think algorithms and understand. And of course, to my creativity.

About the GUI, I decided to hold off for a while. After I master the most things about classes, methods and inheritance and packages etc., then I would take little steps into it. Coming from Basic (Not mastered everything of it - It was a 'very free time' hobby), that class thing is a little tough for me. I thought if I would ever give up, the reason would be classes. But Oracle tutorials cover the basics, and as I mentioned before, the rest is up to me.