Professional Documents
Culture Documents
A. Objective:
Implement a simple java program and test the java development environment by executing this java
program.
E. Practical Outcome
After completion of this practical student will be able to, 1. Develop
and run a simple java program.
G. Prerequisite Theory:
226120316030 21 | P a g e
Object Oriented Programming with JAVA (4341602)
To execute any Java program, the following software or application must be properly installed.
Install the JDK if you don't have installed it, download the JDK and install it.
Set path of the jdk/bin directory.
Create the Java program
To compile the Example program, execute the compiler, javac, specifying the name of the
source file on the command line, as shown here:
C:\>javac Example.java
The javac compiler creates a file called Example.class that contains the bytecode version of
the program. Java bytecode is the intermediate representation of your program that
contains instructions the Java Virtual Machine will execute. Thus, the output of javac is not
code that can be directly executed.
To actually run the program, you must use the Java application launcher called java. To do so,
pass the class name Example as a command-line argument, as shown here:
C:\>java Example
Parameters used in First Java Program class keyword is used to declare a class in Java. public
keyword is an access modifier that represents visibility. It means it is visible to all. static is a
keyword. If we declare any method as static, it is known as the static method. The core advantage
of the static method is that there is no need to create an object to invoke the static method. The
main() method is executed by the JVM, so it doesn't require creating an object to invoke the main()
method. void is the return type of the method. It means it doesn't return any value. main
represents the starting point of the program.
String[] args or String args[] is used for command line argument.
System.out.println() is used to print statement. Here, System is a class, out is an object of the
PrintStream class, println() is a method of the PrintStream class.
I. Resources Required
S. No. Instrument/Components / Specification Quantity
Software
1. Computer System Operating System: Any Operating System NA
Processor: At least 1GHz processor
Physical Memory: 128 MB or higher
Disk space required: 256 MB for JDK
226120316030 22 | P a g e
Object Oriented Programming with JAVA (4341602)
……………………………………………………………………………………………………………………………………………….
……………………………………………………………………………………………………………………………………………….
……………………………………………………………………………………………………………………………………………….
……………………………………………………………………………………………………………………………………………….
……………………………………………………………………………………………………………………………………………….
……………………………………………………………………………………………………………………………………………….
N. References / Suggestions
1. https://www.javatpoint.com/simple-program-of-java
226120316030 23 | P a g e
Object Oriented Programming with JAVA (4341602)
O. Assessment-Rubrics
Presenting practical
Watched other session but not
Performed Practical Performed Practical students performing
Engagement 5 attentively
him / her self with others help practical but not
tried him / her self participated in
performance
Partially understood
Understanding Fully understood the Understood the performance & Partially understood
& 5 performance & can the performance but and cannot give
Explanation explain perfectly cannot explain can give little explanation
explanation
Work is submitted
Work done after Work submitted
Completed the work later than 1st week
Time 5 2nd week but before
within 1 week but by the end of
the end of 3rd week after 3rd week time
2nd week
226120316030 24 | P a g e