Search
  • +44-7459919437 (UK- WhatsApp & Direct Call) | +91-6383544892 (India - WhatsApp Only) | Email Id : vinothrwins@gmail.com
Vinoth Tech Solutions
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I

Java For Automation

  • What is Java?
  • Why to Learn Java?
  • History of Java
  • Types of Java Applications
  • Naming Conventions
  • Hello World Program
  • Internal Details of Java program
  • What is Java JDK, JRE and JVM ?
  • What is Java Comments ?
  • What is Java Variable?
  • Variable Naming convention
  • Primitive Data Types
  • Non Primitive Data Types
  • Type Casting
  • Java Arithmetic Operators
  • Relational Operators
  • What is logical operators in Java? 
  • What is Assignment Operators in Java? 
  • What is Unary Operators in Java? 
  • What is Ternary Operators in Java?
  • What is Java Control Statements?
  • What are Decision Making statements?
  • What are looping statements?
  • What are Jump statements?
  • What is OOPS concept in Java?
  • Advantages of Java OOPs
  • What is Java Inheritance?
  • What is Java Constructor?
  • What is this keyword?
  • What is Polymorphism?
  • What is super keyword ?
  • What is final keyword? 
  • What are access modifiers?
  • What is Encapsulation? 
  • What is Abstraction? 
View Categories
  • Home
  • Tutorials
  • Java
  • Java For Automation
  • Hello World Program

Hello World Program

Hello World Program

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Explanation #

1. Class Declaration

public class HelloWorld {

– public: This is an access modifier. It means that this class is accessible from any other class.

– class: This keyword is used to declare a class in Java.

– HelloWorld: This is the name of the class. By convention, class names in Java start with an uppercase letter and use CamelCase.

2. Main Method Declaration

public static void main(String[] args) {

– public: This access modifier means that the main method can be called from outside the class.

– static: This keyword means that the method belongs to the class, not instances of the class. This allows the JVM to call the main method without needing to create an instance of the class.

– void: This keyword means that the method does not return any value.

– main: This is the name of the method. It’s the entry point of any Java application. The JVM looks for this method to start executing a program.

– String[] args: This is an array of String objects. It allows the program to accept command-line arguments. args is the name of the array, and it can be any valid identifier.

3. Method Body

System.out.println("Hello, World!");
    }
}

– System: This is a predefined class in the java.lang package that provides access to system resources.

– out: This is a static member of the System class. It’s an instance of PrintStream used to output text to the console.

– println: This is a method of the PrintStream class. It prints the specified string to the console, followed by a newline character.

– “Hello, World!”: This is a string literal. It represents the text that will be printed to the console.

Putting It All Together #

When you run this program, the following steps occur:

  1. The JVM starts and looks for the main method in the HelloWorld class.
  2. It executes the main method.
  3. Inside the main method, System.out.println(“Hello, World!”); is executed.
  4. The println method prints the string “Hello, World!” to the console, followed by a new line.

Summary

– Class Declaration (public class HelloWorld): Defines a class named HelloWorld.

– Main Method (public static void main(String[] args)): The entry point for the program.

– Print Statement (System.out.println(“Hello, World!”);): Outputs “Hello, World!” to the console.

By understanding each part of this simple program, you gain a foundational understanding of Java syntax and structure

Java
What are your Feelings
Share This Article :
  • Facebook
  • X
  • LinkedIn
Naming ConventionsInternal Details of Java program
Table of Contents
  • Explanation
  • Putting It All Together
© 2018 – 2025 Vinoth Tech Solutions Ltd (UK), Reg. No: 16489105