How to Write Your First Java Program with Example
Java Programming

How to Write Your First Java Program with Example

 

Simple Program of Java Language

import java.io.*;
class welcome
{
public static void main(String aa[])
{
System.out.println(“Welcome in Java programming language”);
System.out.println(“Java is developed by James Gosling”);
System.out.println(“This language was initially called as Oak”);
}
}

How to run Java Program

Compile and execute :

  1. First, we write the source code of the program in java Language using an editor like notepad.

2. Save this file as welcome.java in the bin folder using the jdk1.6.0 version.

3. Write these commands on the prompt to run the java program like below.

To compile–javac welcome.java

To execute:–java welcome

Simple Java Program

Recommended Posts

C++ Programming

Visibility modes in C++

In C++, visibility modes refer to the accessibility of class members (such as variables and functions) from different parts of a program. C++ provides three visibility modes: public, private, and protected. These modes control the access levels of class members concerning the outside world and derived classes. Public: Members declared as public are accessible from […]

Rekha Setia 
C++ Programming

Inheritance in C++

In C++, inheritance is a fundamental concept of object-oriented programming (OOP) that allows you to create a new class based on an existing class, known as the base or parent class. The new class is called the derived or child class. Inheritance facilitates code reuse and supports the creation of a hierarchy of classes. There […]

Rekha Setia 
C++ Programming

C++ Classes and Objects

In C++, classes and objects are fundamental concepts that support object-oriented programming (OOP). Here’s a brief overview of classes and objects in C++: Classes: In C++, a class is a user-defined data type that allows you to encapsulate data members and member functions into a single unit. Classes are the building blocks of object-oriented programming […]

Rekha Setia 

Leave A Comment