View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Beginner Java Questions

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1destructivArts  Members

Posted 03 May 2011 - 03:07 PM

I just have a few questions about learning Java, that my book doesn't seem to cover,
First :
public static void main(String[] arguments){
}

Could someone please go through this line and tell me what it all means?

Second:
About how long does it usually take someone to teach themselves a programming language?
Do you have a reference of some sort? There are so many commands I don't see how you could know them all.
All the separate libraries that are included in Java, how do you find them all, and learn how to use them?

Peter
-------------------------------------
"Other than that, I have no opinion."
My Blog - Check it Out

### #2PREDATOR_UK  Members

Posted 03 May 2011 - 03:18 PM

Public: This means the function can be accessed by other classes

Static: This is just an instance to access the class

Void: Means it returns no values

"main": The starting point to every program / the function name

String[]: This part means that the function takes a string called argument into it's parameters

Hope this clears some things up on the first question. As for the second question I have known people who have been in the programming industry for many years and even they still don't know the language fully. It is very rare that you will actually finds someone that knows everything about one language. To teach yourself the stuff you need depends on your current knowledge level and how quickly you learn / how much you are willing to put into learning. Buy some books and read andn understand the fundamentals of the language then move onto the stuff that you want to get into ( Graphics programming, model scripting, logic models etc... ) If you have any more questions just ask me
AMD Phenom II X6 1090T 3.2GHz
XFX ATI Radeon 5770 1GB GDDR5
ASUS M4A89GTD Pro USB 3.0
CORSAIR XMS3 4GB 1600MHz
THERMALTAKE V3
SEAGATE 500GB
WINDOWS 7 ULTIMATE 64 Bit

### #3zacaj  Members

Posted 03 May 2011 - 03:23 PM

I dont code in java much, but:
public: this function can be called from outside its class (since its main, it needs to be called to start the program!)
static: This function can be called without having a copy of the class its it
ex: (the file is mMin.java)
//You dont need to do this:
Main main=new Main();
main.main(arguments);
//you can just do this:
Main.main(arguments);
//without calling new first
void: this function doesnt return any value
String[] arguments: an array of Strings, each one is one argument passed to java
ex:
java file.java ARGUMENT0 ARGUMENT1
I use the reference pages whenever I need to lookup something. I usually just assume that its probably somewhere in the libraries, from experience with whats usually included
If you dont understand any of that, i can elaborate, but you werent really specific about how experienced a programmer you were in genreal...

### #4Wooh  Members

Posted 03 May 2011 - 03:29 PM

"public" means the method can be accessed from outside the class, and opposite of "private".
"static" means that the method can be called without creating an instance of the class. Say that the method f is defined in class A. If it is static we can call A.f(). If it isn't static we have to first create an instance of A to call the method on. A a = new A(); a.f();
"void" means that the function has no return value.
"main" is the name of the method. The main method is the starting point of the program.
"String[] arguments" is the method parameters that can be passed to the function. In this case it is an array of strings, that can be passed to the program when the program is started.

How long does it take to learn a programming language? well, you will never learn everything. Lot of things can be looked up in the API: http://download.orac...ase/6/docs/api/

### #5Antheus  Members

Posted 03 May 2011 - 05:13 PM

Public: This means the function can be accessed by other classes

Static: This is just an instance to access the class

Void: Means it returns no values

"main": The starting point to every program / the function name

String[]: This part means that the function takes a string called argument into it's parameters

Required watching.

### #6menyo  Members

Posted 03 May 2011 - 05:43 PM

About how long does it usually take someone to teach themselves a programming language?
Do you have a reference of some sort? There are so many commands I don't see how you could know them all.
All the separate libraries that are included in Java, how do you find them all, and learn how to use them?

My advice is get c# and XNA, you will be making games within 100 hours of learning. No not the next best MMO but still really nice games.

Just do it step by step, do a c# calculator tutorial first then some simple c# command prompt game tutorial.
Then move to XNA, learn how to draw sprites, move 'm, animate 'm with small tutorials. You will be making your own pong/break out clone within a week.

I'm now like 100 to 150 hours into c# and XNA and i have almost finished my own isometric tilemap editor i'm going to use for a real cool xcom/fallout clone i have in mind. Read my blog in my sig to see exactly where and how i learned this.

Latest finished project Project

### #7zac.davis  Members

Posted 03 May 2011 - 05:50 PM

My advice is get c# and XNA, you will be making games within 100 hours of learning. No not the next best MMO but still really nice games.

Just do it step by step, do a c# calculator tutorial first then some simple c# command prompt game tutorial.
Then move to XNA, learn how to draw sprites, move 'm, animate 'm with small tutorials. You will be making your own pong/break out clone within a week.

I'm now like 100 to 150 hours into c# and XNA and i have almost finished my own isometric tilemap editor i'm going to use for a real cool xcom/fallout clone i have in mind. Read my blog in my sig to see exactly where and how i learned this.

Quit plugging your blog, you are not really helping anyone with this sort of stuff.

### #8Ben Apuna  Members

Posted 03 May 2011 - 09:20 PM

Hi I began learning Java a little while ago as well.