Labsheet#03
Labsheet#03
Labsheet#03
Objective- Main aim of this lab is to get familiar with Java coding, Java program compilation and running of Java program. Program-1: Write a simple java program for Hello World!.
Once the compilation is successful a new file will be created with the name HelloWorld.class. To run the program issue the following command on command prompt: C:\javatutorial\example>java HelloWorld You will see the following result on the command prompt. Hello World! Here is the screen shot of the above steps:
In this lesson you have learned how to write and then test the Hello World! java program.
Class Declaration: Class is the building block in Java, each and every methods & variable exists within the class or object. (instance of program is called object ). The public word specifies the accessibility of the
class. The visibility of the class or function can be public, private, etc. The following code declares a new class "HelloWorld" with the public accessibility: public class HelloWorld {
Home Assignment Problem1. Write a java program for listing out all the even numbers between
two numbers.
Problem2. Write a java program for preparing the table of a given number by
using loop condition.