Sep 8, 2024
System.out.print() or System.out.println()
print() keeps the cursor on the same lineprintln() moves the cursor to the next line after printingSystem.out.println("Hello World");\n
int a = 25;String name = "Tony Stark";byte, short, int, long (for integers)float, double (for floating-point numbers)char (for characters)boolean (for true/false)import java.util.Scanner;Scanner sc = new Scanner(System.in);sc.nextInt() for integerssc.nextLine() for stringsint sum = a + b;