Showing category "Java" (Show all posts)

Java First Program "HelloWorld"

Posted by jineesh uvantavida on Thursday, January 6, 2011, In : Java 
// Outputs "Hello, world!" and then exits
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}


In this program, we are defining the class HelloWorld. And the file name should be HelloWorld.java. This simple program only contains a single line to print "Hello, world!".
And every program should contain a main class to execute the program.
Continue reading ...
 

Basics that everyone must know to create a Java program

Posted by jineesh uvantavida on Thursday, January 6, 2011, In : Java 
For a beginner to start creating programs in Java,
1. Install Java environment. (JDK)
2. Write a Java Program.
a. Write the Java program in a text document and save it with ".java" extension.
b. The name of the java file should be the class name in the program.
3. Compile Java Program.
a. To compile the java program using command prompt, we have to use some commands.
- Open DOS prompt. (Press "Window+R" -->> write "cmd" --->> press "Enter")
- Change the command prompt directory to the director...
Continue reading ...
 

Writing Comments in Java Programs

Posted by jineesh uvantavida on Thursday, January 6, 2011, In : Java 
// This is an example of a single line comment using two slashes
 
/* This is an example of a multiple line comment using the slash and asterisk.
   This type of comment can be used to hold a lot of information or deactivate
   code but it is very important to remember to close the comment. */
 
/** 
 * This is an example of a Javadoc comment; Javadoc can compile documentation
 *  from this text. 
 */

Continue reading ...
 

Understanding Java With Examples

Posted by jineesh uvantavida on Thursday, January 6, 2011, In : Java 
   


We can try to understand Java Programming Language by doing examples. With very simple programs. So that we can add up them and use those methods to do complex programs.


Continue reading ...
 
 

Translate This Page

 


Make a free website with Yola