What is the best way to learn Java if you have trouble concentrating on what you are doing?

I want to learn Java for personal and perhaps ultimately professional use, but every time I take a book, I lose focus, forget everything, and I have to read everything. Is there a better way to learn Java or any programming language in general, and then using a book such as the first chapter of Java?

+6
java
source share
11 answers

Think of an interesting project, and then try to implement it in the language you want to learn. Thus, you are not just reading a book, but using it to do something useful.

EDIT: Personally, I would recommend choosing a project that has graphics. For me, seeing a program, drawing something cool on the screen helps me interest.

+14
source share

Sit in front of the computer, close the browser !!!, turn off the music, and then while reading a book, try to enter and compile all the examples and complete all the exercises.

+3
source share
+2
source share

Motivation is an important factor.
First you need to define a goal, a simple goal that you want to achieve.

Then, instead of reading a book from A to Z, you yourself are trying to realize this goal. Every time you block something you donโ€™t know, check the book or on the Internet.

Thus, you will succeed for small goals that will keep your motivation.

Examples of goals:

  • print the sum of numbers from 1 to 10
  • enter the number N and display N points on the screen
  • enter the word and change all 'a' to 'e'
  • ...

Another thing that may be impractical. If the language itself is a problem, there are simpler and more interesting languages โ€‹โ€‹to learn than Java, and it's easier to start with them. For example, PHP.

+2
source share

In the beginning, you can try to write simple and funny (maybe card games) programs. How can you rewrite these programs with what you have learned (promote OOP topics, such as expanding objects, interfaces).

As your program becomes more complex, you can understand that you cannot go forward without proper OOP design. Over time, you understand OOP, and I'm sure you find OOP exciting, because it is a reflection of the real world.

You can use the Java Swing GUI input component for input, so you don't have to deal with console input. Here is an example for inputs and outputs of the Swing GUI.

import javax.swing.JOptionPane; //just write this line at the top of your class public class Main { // Main is your class name public static void main(String[] args) { // that function is executed when program is opened //simple text input String str = JOptionPane.showInputDialog("Input some text"); JOptionPane.showMessageDialog(null, "your text is: " + str); //output // turns your text input into a number int x = Integer.parseInt(JOptionPane.showInputDialog("Input some integer number")); JOptionPane.showMessageDialog(null, "your integer is: " + x); //output } } 
+2
source share

I agree with the other answers - sitting before programming on a PC (or trying) is much more fun than just reading about it. Entering the examples is a good start or downloading them from the media that comes with the book, but also an experiment with your own changes in the code of the examples.

Read the code and ask yourself questions - why is there a colon? What does this sign mean? Why is the method declared static? etc. If you do not know the answer, use a book (or SO!) To find the answer.

+1
source share

Programming is a mathematical thing .. you need to practice a lot in order to concentrate and learn (really, like remembering in time) language ...

I suggest, if you see something that interests you, how it was done, try to recreate it in the language you want to learn! ... a lot helps.

+1
source share

You should first browse the book for some theories and ideas. When doing this or after reading, think of a small project in which you can apply any of the concepts that you learned from the book. Even the simplest hello world program is a good start. Then slowly move on to more complex things. It would be easier if you liked what you are doing, so focus on what will be useful in your small project.

+1
source share

Ok, so I like some of the answers, but for someone who has problems with concentration, these are the same old answers.

This is a problem that I am facing all the time and will be facing next year when I try to take a Java class.

The best I can tell you is to find a place where you can focus somewhere, there is minimal distraction, but it is not too quiet or too loud. Incidentally, I like the laundry room, the noise is constant, and there is little distraction.

Then find the Java formula and try to use it in what you are doing at that time. Find ways to participate in what you are trying to learn.

Like the hands of a student who, like me, from your letter, seems to be the best way to find out. To do something creative because of hearing about someone else, it can upset and remove motivation.

Good luck with your problem, and I hope this helps! :)

+1
source share

Use the Pomodoro Technique to focus so you can practice. Also write down the time you set for the time, and gradually increase it.

Also, use a wiki with a journal function so that you can tag what you read and what you donโ€™t have read.

Realize something real (not just theory) as described above, but also take notes on what you actually did in case you have to do it again. Make examples for yourself so that you can later refer to them in a similar situation.

0
source share

For me, reading Java is fun ...

Unlike any other language, you can read java with real-world objects. Letโ€™s say, for example, think about a girlfriend, then imagine how abstract she is, how polymorphic she is and poses as a boy friend and imagines how a message happens between you and her.

Just do the paper work and convert what you ever draw / mark in the document in the POSO.

How wise you can learn java .. with the world of Google you don't need to memorize everything (syntax). Just try to hide every methodology in some real situation. You can easily remember the concepts ...

Don't just read .. read minds and shape your own path.

Perhaps the first chapter can help you get started ( http://books.google.com/books/about/Head_First_Java.html?id=lXEBwv0LYogC )

0
source share

All Articles