0% found this document useful (0 votes)
58 views2 pages

Java Online Training: Java Tutorial For Beginners - Part 1

java

Uploaded by

DiptiJha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views2 pages

Java Online Training: Java Tutorial For Beginners - Part 1

java

Uploaded by

DiptiJha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java tutorial for beginners - Part 1

Free Java Guide


Programming Tutorials

These tutorials will introduce you to Java programming Language. You'll compile and run your own Java application, using
Sun's JDK. It's extremely easy to learn java programming skills, and in these parts, you'll learn how to write, compile, and
run Java applications. Before you can develop corejava applications, you'll need to download the Java Development Kit
(JDK).

History of Java

SCJP Notes 1

Java Online Training

SCJP Notes 2

Core Java Training Courses by Industry Experts. Join us Now

Free JAVA Tutorials

SCJP Notes 3
SCJP Notes 4

PART-1

SCJP Notes 5

Java Hello World Program


Java Comments
Java Data and Variables
Java Command Line Arguments

SCJP Notes 6
SCJP Notes 7
SCJP Notes 8
Java Test

Java Hello World Program

JDBC Program Tutorial


Java Swing
Java Source Code
Java Applet
Java Servlet
JavaServer Pages
Criticism of Java

Our first application will be extremely simple - the obligatory "Hello World". The following is the Hello World Application as
written in Java. Type it into a text file or copy it out of your web browser, and save it as a file named HelloWorld.java. This
program demonstrates the text output function of the Java programming language by displaying the message "Hello
world!". Java compilers expect the filename to match the class name.

Study in Germany
Find Top Colleges in Germany. Get Info on Admission,Visa,Scholarships

SQL Tutorial
PLSQL Tutorial
PLSQL Examples
HTML Tutorial

A java program is defined by a public class that takes the form:


public class program-name {

What is XML?

optional variable declarations and methods

XML Tutorial
public static void main(String[] args) {
statements
}

Job Interview Questions


Java Interview
SQL Interview

optional variable declarations and methods

XML Interview
}

HTML Interview

Partner websites

Source Code

Bird Watching
Haryana Online
Asia Newscast
North India Online

In your favorite editor, create a file called HelloWorld.java with the following contents:
/** Comment
* Displays "Hello World!" to the standard output.
*/
class HelloWorld {
public static void main (String args[]) {
System.out.println("Hello World!");

//Displays the enclosed String on the Screen Console

}
}

To compile Java code, we need to use the 'javac' tool. From a command line, the command to compile this program is:
javac HelloWorld.java
For this to work, the javac must be in your shell's path or you must explicitly specify the path to the program (such as
c:\j2se\bin\javac HelloWork.java). If the compilation is successful, javac will quietly end and return you to a command

prompt. If you look in the directory, there will now be a HelloWorld.class file. This file is the compiled version of your
program. Once your program is in this form, its ready to run. Check to see that a class file has been created. If not, or you
receive an error message, check for typographical errors in your source code.
You're ready to run your first Java application. To run the program, you just run it with the java command:
java HelloWorld
Sample Run
Hello world!
The source file above should be saved as myfirstjavaprog.java, using any standard text editor capable of saving as ASCII
(eg - Notepad, Vi). As an alternative, you can download the source for this tutorial.
HelloWorld.java

Note: It is important to note that you use the full name with extension when compiling (javac
HelloWorld.java) but only the class name when running (java HelloWorld).

You've just written your first Java program! Congratulations!!


Next: Java Comments
Part 1 of 5

Previous

Copyright 2006-2013 Free Java Guide & Tutorials. All Rights Reserved.

Next

You might also like