- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Analysis of Java "Hello World" Program
Consider the below “Hello World” program.
public class MyFirstJavaProgram { /* This is my first java program. * This will print 'Hello World' as the output */ public static void main(String []args) { System.out.println("Hello World"); // prints Hello World } }
Analysis −
public − scope of the class. Public means visible to all.
class − declares the class in java.
/* */ − Comments section.
static − marks element as static so that it can be accessed without creating the object.
void − return type of the function. void refers to nothing.
String[] args − command line arguments.
System.out.println() − print the statement on the console.
public static void main() − the main method is startup method of java program. It is visible to all, it is static, so no object is required, and it is not returning any value.
- Related Articles
- Internal Analysis of Java "Hello World" Program
- Creating Java Hello World Program
- Hello World Program in Java
- C++ "Hello, World!" Program
- A closer look at Java "Hello World" program
- Hello World program in Kotlin
- Python Program to Print Hello world
- Haskell Program to print Hello World!
- Swift program to print Hello World!
- Beginning Java programming with Hello World Example
- Beginning Java programming with Hello World\n
- How to write "Hello, World!" program in JavaScript?
- How to write "Hello World" Program in C++?
- Hello World using Perl.
- Display hello world using React.js

Advertisements