Java Program
First Java Program-Example 1
/*This
is a simple java program*/
class
Example
{
public static void main (String args[])
{
System.out.println (“This is a simple Java program”);
}
}
Simple Java Program-Some
important points
üpublic: Access specifier. main() must be
made
public, since it must be called by code defined
outside it’s class.
üStatic: It is required because main() is
called
without creating an object of it’s class.
üString args[]: An array of objects of type String
class. Each object of type string contains a
character string. It is used to
manipulate command
line argument.
üJava is case sensitive.
üSystem predefined class that refers to
system.
out It is static data member of System
class
println()
It is a member of out object.
JRE and JDK
üJRE:
J2SE Runtime Environment
üprovides
ülibraries,
üJava virtual machine,
üother components necessary for you to run
applets and applications
üJDK:
J2SE Development Kit
üincludes
üJRE
ücommand-line development tools such as
compilers and debuggers
No comments:
Post a Comment