Class Notes for Output |
|
// Prints to screen
System.out.println("Adam Truncale");
// Prints but stays on current line after output
System.out.print("Hello");
// Prints blank line
System.out.println();
System.out.println("This is a \"quote\"");
System.out.println("This is a \t tab");
System.out.println("This is a forward // slash");
System.out.println("This is an apostrophe \'");
System.out.println("This is a line \n break");
//Will add numbers/variables until it reaches a string
//Treats rest of number/variables as strings.
System.out.println(1+2+"=3");
System.out.println("3="+1+2);
//if you want them to add put them in ()
System.out.println("3="+(1+2));
Videos |
|