Jump to content

  • Log In with Google      Sign In   
  • Create Account

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.

  • You cannot reply to this topic
7 replies to this topic

#1 destructivArts   Members   -  Reputation: 205

Like
0Likes
Like

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?

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

Sponsor:

#2 PREDATOR_UK   Members   -  Reputation: 102

Like
1Likes
Like

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

#3 zacaj   Members   -  Reputation: 643

Like
0Likes
Like

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...

#4 Wooh   Members   -  Reputation: 622

Like
0Likes
Like

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/

#5 Antheus   Members   -  Reputation: 2397

Like
0Likes
Like

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.

#6 menyo   Members   -  Reputation: 449

Like
-2Likes
Like

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.

Current Project: TechnoFlux read all about it on my

DEV BLOG


#7 zac.davis   Members   -  Reputation: 114

Like
0Likes
Like

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.




#8 Ben Apuna   Members   -  Reputation: 106

Like
0Likes
Like

Posted 03 May 2011 - 09:20 PM

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

I believe the others have already answered your questions better than I could.

I just wanted to add that there is a free series of lectures on YouTube about Java and Computer Science from Stanford University which seem to be very good so far (I'm up to lecture 10) and may be of use to you.

The playlist for the course is here. The materials for the course can be found here. Free pre-press versions of the textbooks can be found here. The Art and Science of Java is a pretty dry reading experience but I've been learning a lot by reading it and doing the exercises.

I hope that helps.




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.



PARTNERS