lesson 2 part 1

package lesson.pkg1; /** * * @author anfal */ public class Lesson2 { public static void main(String[] args) { //** Types Of Errors //compile errors System.out.print(""); //runtime errors System.out.println(5 / 1); //logic errors System.out.println( (1 + 3) * 2); //** data types //primitive: //numbers: int, long, short, double, float //other: char, boolean //declaration: int x; int y; //assignment: x = 3; y = 4; //declare and assign: int z = 0; //operations: System.out.println( x * y ); z = x * y; //constants: final double percentage = 0.02; //naming conventions: int twoWords; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.