java programming for beginner code example
Example 1: java tutorial for beginners
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
}
}
Example 2: java coding for beginners
= Output: 10
+= Output: 20
-= Output: 10
*= Output: 200
/= Output: 10
%= Output: 0