Chapter 8: Basic Structure Of A Java Program
Chapter 8: Basic Structure Of A Java Program
class HelloWorld
{
public static void main (String args[])
{
System.out.println("Hello World");
}
}
1) The class keyword defines a class with name HelloWorld
2) The next comes the main() function which is necessary in every Java program structure, the main program logic and code is made inside this function. We shall be focusing only on the program segment inside the main function for now.
3) The next comes System.out.println("Hello World"); the function println() from the package System.out is imported by default in a java program. It prints the value given inside the parantheses () and then changes the line
// NEW CHAPTERS COMING FROM 29th DECEMBER 2022
Comments
Post a Comment