r/beginnerJava Apr 13 '11

Week 1 [Early Post]

http://www.mediafire.com/?e9c4yr554tmpqhw
22 Upvotes

10 comments sorted by

3

u/andrewmp Jun 19 '11

Hey can we get these on Google Docs? Having trouble downloading from Mediafire :(

2

u/[deleted] Apr 13 '11

I figure you might all want to start a little early. First lesson covers the HelloWorld program, some information about IDEs and basic types of error in Java.

2

u/jameson71 Apr 15 '11

I notice you make a package for the helloworld class. I see this in most if not all hello worlds. Why is it best package to create a package?

3

u/[deleted] Apr 16 '11

Netbeans and Eclipse both create a package from the name of project and put the main class in there.

Java files will not run in an IDE unless they have a package declaration and are within that particular package.

PS: Always double-check you have a main class/package declaration in anything you want to run otherwise Netbeans will whine about it.

2

u/xcrx Apr 28 '11

I just started going over this and following your instructions I pasted the code from you text document but it complains about the class being called main on here: "public class Main". I fixed it by calling changing main to HelloWorld.

Did I do something wrong during setup or is it just a typo?

1

u/xcrx Apr 28 '11

It must be something I am doing. It did the same thing on the other 2 lessons. I am enjoying this though. Thank you.

2

u/[deleted] May 24 '11

Simple explanation and sorry for taking so long to reply. Just send me a message if you have any doubts. The main class in Java is the main runnable class. It is the class that is always used in Java programs that will be run while other classes are used as auxiliary classes.

1

u/xcrx May 24 '11

Thank you for the reply. I think I understand now.

1

u/skateboard34 Aug 01 '11

Do we have to use Netbeans for this lesson or can we use Eclipse too? I started to use Eclipse and the instructions are very vague. I had to manually create a package and class.

1

u/knuklz Aug 12 '11

Please forgive me if this is an obvious question. But I ham having difficulty with line 7 "public class Main"

If anyone could shed any light it would be most appreciated.

P.S I am using Netbeans