System.out.println()
System.out.println("Hello World");
Variable definition
Data type variable name;
String hello;
hello = "Hello World";
System.out.println(hello);
The meaning is the same here as well
String hello = "Hello World";
System.out.println(hello);
** Forced conversion (cast) ** Force type conversion on output
Example: I want to output the calculation result between int types with a decimal point (it is not originally a decimal point)
int num1 = 10;
int num2 = 4;
System.out.println((double)num1 / num2);
Recommended Posts