Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Very First Thing To learn?
Index -> Programming, Java -> Java Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Kyle




PostPosted: Mon Jun 27, 2005 11:32 am   Post subject: Very First Thing To learn?

Ok all of you might think im a big dumb @$$ for posting this but i downloaded NerBeans 4.1 last night. and i just finished grad 10 computer science (Turing and i think i did ok in that class) Now im going to be tacking Java in grade 11 and i have no idea how touse netbeans or how to program in Java. Im asking how do you out put text to the screen i was given a line cant remeber but i tryed it and it did not work. is Netbeans for beginers? and how do you output text to the screen?
Sory if my lack of Java programing disterbs you guys.
Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Aziz




PostPosted: Mon Jun 27, 2005 12:43 pm   Post subject: (No subject)

This is what you need. Start from the beginning. Java isn't like Turing. Turing you can simply say "put "Hello World!"", but Java is strictly object-orientated, everything is done in classes, and you need to set up your enviroment. Read this, and ask your teaching for a textbook:

http://java.sun.com/docs/books/tutorial/
Kyle




PostPosted: Mon Jun 27, 2005 1:38 pm   Post subject: (No subject)

hmm thanks alot pal that rely helps. Very Happy
Aziz




PostPosted: Mon Jun 27, 2005 2:44 pm   Post subject: (No subject)

Not a problem. Good look diving into Java Razz
Kyle




PostPosted: Mon Jun 27, 2005 9:19 pm   Post subject: (No subject)

ok at that site you sent me it gives me an example of how to output "Hello World" on to the screen.
code:
/**
 * The HelloWorldApp class implements an application that
 * simply displays "Hello World!" to the standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); //Display the string.
    }
}

When i try to run this example it says <No main classes found> or < class "filename" does not have a main method. this might be easy for you guys but this is my first day. So what does this mean....... Im using Netbeans 4.1. Rolling Eyes
Naveg




PostPosted: Mon Jun 27, 2005 10:01 pm   Post subject: (No subject)

the square brackets go after the args

code:
public static void main (String args[])
wtd




PostPosted: Mon Jun 27, 2005 10:28 pm   Post subject: (No subject)

Vladimir wrote:
the square brackets go after the args

code:
public static void main (String args[])


No. They don't.

Replace "class HelloWorldApp" with "public class HelloWorldApp".
Naveg




PostPosted: Mon Jun 27, 2005 11:09 pm   Post subject: (No subject)

That too Embarassed
Sponsor
Sponsor
Sponsor
sponsor
Kyle




PostPosted: Tue Jun 28, 2005 8:18 pm   Post subject: (No subject)

hmm... nope. the code is
code:
public class HelloWorldApp {
    public static void main(String args []) {
        System.out.println("Hello World!"); //Display the string.
    }
}

still i get <No main classes found> or < class "filename" does not have a main method ... hmm i think i did what you gys said. . . Embarassed
rizzix




PostPosted: Tue Jun 28, 2005 8:42 pm   Post subject: (No subject)

post ur file...
Kyle




PostPosted: Tue Jun 28, 2005 10:13 pm   Post subject: (No subject)

Confused hmm ok thats all the code so heres the file Sad


JavaApplication4.rar
 Description:
heres the JavaApplication Folder with the file I think :?.

Download
 Filename:  JavaApplication4.rar
 Filesize:  7.63 KB
 Downloaded:  101 Time(s)

rizzix




PostPosted: Tue Jun 28, 2005 11:13 pm   Post subject: (No subject)

ehm... some project settings in netbeans??... try changing ur filename to HelloWorldApp.java or the class name to Main.

it is a standard convention in java to name the .java file after the class name (or visa versa).. please do follow the conventions.
Kyle




PostPosted: Wed Jun 29, 2005 8:50 pm   Post subject: (No subject)

Crying or Very sad Crying or Very sad Crying or Very sad hmm i tryed naming the class to Main but still nothing. I dunno what im going to do... im taking Java in school next year Sad Sad Sad Embarassed ... I dought that the schools use netbeans... Is there an easer program for beginers that no nothing at all about Java. I heard that [ Ready to Program is very easy] but i dunno if its free, Can you send me a link to an easy program which i can learn jave easly. Please Embarassed Sad Sad Sad Sad
wtd




PostPosted: Wed Jun 29, 2005 9:16 pm   Post subject: (No subject)

Ifyou want something easier to use for this level of programming, simply use a text editor and the command-line tools Sun provides.
Kyle




PostPosted: Wed Jun 29, 2005 9:26 pm   Post subject: (No subject)

ok thanks i will read up on that. Very Happy THANKS Very Happy
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 27 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: