0% found this document useful (0 votes)
9 views8 pages

Simple Java Programming Guide

The document provides instructions for writing and running a simple Java program. It recommends using Notepad to write code for a class called Siva with a main method that prints two strings. It describes how to save the file as Siva.java, compile it using javac at the command prompt after setting the PATH to the Java compiler location, and run the program using java. The programmer, M.SivaKameswara Rao, provides their email for any questions.

Uploaded by

sivamskr
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)
9 views8 pages

Simple Java Programming Guide

The document provides instructions for writing and running a simple Java program. It recommends using Notepad to write code for a class called Siva with a main method that prints two strings. It describes how to save the file as Siva.java, compile it using javac at the command prompt after setting the PATH to the Java compiler location, and run the program using java. The programmer, M.SivaKameswara Rao, provides their email for any questions.

Uploaded by

sivamskr
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

Java programming made simple by

[Link] Rao

Java [Link] simple!!!


[Link] Rao

Its always better if you have gone through my beginning notes. Even, otherwise, let me make it simple. What you need? An editor where you can write your program(notepad can do!!!) Install jdk (I suggest to install versions above 5 ---java 6/java 1.6 both mean the same)

Open the note pad and write a simple java program(dont mess it up just copy paste this program!)

public class Siva{ public static void main(String [] args){ [Link](This is the first java program); [Link](by [Link] KAMESWARA RAO); }

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

Now after installing the jdk you will have to set the path of the dos prompt to the location where java compiler ( To do this follow this: My computer properties advanced settings variables variable section new environmental

javac

)is installed

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

Variable name = path Variable value = c:\programfiles\........... (location of bin in java1.6 installed on your computer)

Thats all to set the class path on your computer!!!!

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

Lets start programming.

Copy the program above and open notepad paste the program. Now ,save as [Link] Dont change the name for it is the name of class(dont put ur name!!) Remember ,by default, notepad saves with .txt extension( ull have to choose all files in that)

File name : [Link] Save as type : All files

These things look simple but they are the things you need to take care of!!

Now open command [Link] run cmd you need to know few things in command prompt like to change your directory use cd name

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

For example I have my program at E :\java\[Link] See how I have changed my directory pointing to that file(by default it is in c drive))

javac Syntax: Javac [Link]


And compiled using

Now doing this you will have created [Link](bytecode file)

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

To interpret it use java

Syntax: java filename

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

Java programming made simple by

[Link] Rao

Thats all folks!!! Happy programming..!!! Lets meet in the next section..!!!!!!

For any doubts, suggestions meet the programmer at

sivamskr@[Link]

You might also like