| Programming and Web Development Web monks and programmers welcomed |
![]() |
|
|
Thread Tools |
|
lazy bunny
Administrator
|
Luke,the random code in this page is manipulatable right?
i change the > and < and,different things show. my question is how true is the math random? 50:50 if i dont change the sign,by chance i will get different "link" in that page,but i keep on refreshing the page and the link doesnt change unless i change the sign.
__________________
往者不可谏,来者犹可追。尔俸尔禄,民脂民膏,下民易虐,上天难欺。 Federation of Malaysia is formed by Sarawak, North Borneo, Malaya (and Singapore) by 16 Sept 1963. It has nothing to do with 31 Aug 1957. Just saying. |
|
|
|
| The Following User Says Thank You to luke For This Useful Post: |
|
Member
|
If you are the new for java then you must learn the concept given below. First go through the following example and than you will be able to understand the basic logic the JAVA program .
First program in java.. Class A { public static void main(String arg[]) { System.out.println("java is a very interesting language"); } } Logic behind the public method in JAVA The public keyword is an access specifier, which allows the programmer to control the visibility of class members. When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared. (The opposite of public is private, which prevents a member from being used by code defined outside of its class.) In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started. Logic behind the static keyword in the above code. The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made. Logic behind the void keyword in the above code. The keyword void simply tells the compiler that main( ) does not return a value. Logic behind the void keyword in the above code. In JAVA , main( ) is the method called when a Java application begins. Be careful that Java is case-sensitive. Thus, Mainis different from main. It is important to understand that the Java ompiler will compile classes that do not contain a main( ) method. But the Java interpreter has no way to run these classes. So, if you had typed Main instead of main, the compiler would still compile your program. However, the Java interpreter would report an error because it would be unable to find the main( ) method. Logic behind the String arg[] in the above code. In main( ), there is only one parameter. String args[ ] declares a parameter named args, which is an array of instances of the class String. (Arrays are collections of similar objects.) Objects of type String store character strings. In this case, args receives any command-line arguments present when the program is executed. Logic behind the System.out in the above code. System is a class. Out is a static object. Println() is the method of PrintStream class. System.out refers to the standard output stream.
__________________
"You don't stop laughing because you grow old, you grow old because you stop laughing.? |
|
|
|
![]() |
| Bookmarks |
| Tags |
| programming |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML Basics | day_dreamer | Programming and Web Development | 10 | 17-09-2011 12:36 PM |
| Javascript emoticons | johnleemk | Programming and Web Development | 2 | 19-12-2005 01:48 AM |
| ECU Programming | filarnski | Programming and Web Development | 3 | 15-11-2005 11:58 PM |
| WML programming | dyenne10 | Programming and Web Development | 4 | 16-08-2004 12:26 PM |
| Javascript Hacking game | littlebigone | Programming and Web Development | 2 | 21-07-2004 08:42 PM |