Suggested Videos
Part 1 - Java introduction for beginners
Part 2 - Java basics for beginners
Our "Hello World!" program consists of three primary components:
Comments are ignored by the compiler but are useful to other programmers.
/* MultiLine Comments */
/** Java Documentation Comments */
// Single Line Comments
Note : The compiler ignores everything from // to the end of the line.
Understanding Hello World
public : is an access modifier that means it will be accessed by every class out there
void : is a return type i.e it does not return any value
main() : is a method or a function name.
Program
/*
This is a multi
line comment
*/
// Single Line Comment
Compilation
$ javac Program.java
Execution
$ java Program
Part 1 - Java introduction for beginners
Part 2 - Java basics for beginners
Our "Hello World!" program consists of three primary components:
- Source Code
- Comments
- Class definition
- Main method
Comments are ignored by the compiler but are useful to other programmers.
/* MultiLine Comments */
/** Java Documentation Comments */
// Single Line Comments
Note : The compiler ignores everything from // to the end of the line.
Understanding Hello World
public : is an access modifier that means it will be accessed by every class out there
void : is a return type i.e it does not return any value
main() : is a method or a function name.
Program
/*
This is a multi
line comment
*/
// Single Line Comment
public class Program
{
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
Compilation
$ javac Program.java
Execution
$ java Program
![java tutorial for beginners](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD81y1sAgxVkrO3SbEHuy9JRchAi-vaRwL38qNZ1fG7s7E3_XrPIJj-0N-teUq3n_pVD4QzfuXOp2ukJs7RSHGz3aXkcbGS37x4a6b0EzvH-6oVdXjNPTEBRt_t3wj4qG171IPmMLFlDg1/s1600/java+tutorial+for+beginners.png)
No comments:
Post a Comment
It would be great if you can help share these free resources