Introduction of Java Fikri Fadlillah, S.T
Java Object Oriented Programming Mobile : J2ME, Android Desktop : JDK, JRE Enterprise : Java EE Web : Javascript
Java Program public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); }
How to Compile Java ? Create Compile Execute Source code with .java extensions Compile Typing “javac filename.java" Execute Typing “java filename"
Java Program - Variable public class HelloWorld { public static void main(String[] args) { int bil_bul4t; float mc_fl04t; String karakter; char abjad; }
Java Program - Constant public class HelloWorld { public static void main(String[] args) { int bil_bul4t = 1000000; float mc_fl04t = 10.4; String karakter = “java”; char abjad = ”a”; }
Java Program - Operator public class HelloWorld { public static void main(String[] args) { int bil_bul4t; bil_bul4t = 4+9; bil_bul4t = 4*9; bil_bul4t = 4-9; }
Java Program - Operator public class HelloWorld { public static void main(String[] args) { int bil_bul4t; bil_bul4t = 2; if( bil_bul4t > 2 ) System.out.print(“>2”); if( bil_bul4t < 2 ) System.out.print(“<2”); if( bil_bul4t <= 2 ) System.out.print(“<=2”); if( bil_bul4t >= 2 ) System.out.print(“>=2”); if( bil_bul4t != 2 ) System.out.print(“!=2”); if( bil_bul4t == 2 ) System.out.print(“==2”); }
Java Program - Operator public class HelloWorld { public static void main(String[] args) { float mc_fl04t; mc_fl04t = 4/9; }
Requirements JDK Text Editor