Displaying Variable
Code:
VarType varName = content;
System.out.print(varname);
Sample:
String name = "Your name";
System.out.print(name);
Output:
Your name
________________
Displaying morethan one variable/message.
Sample:
Sting name = "Juan";
int age = 16;
System.out.print("Name: " + name + "Age: " + age);
Output:
Name: Juan Age: 16
Note: To concatinate(combine) a variable and strings use the plus sign (+). Beware of concatination, the plus (+) sign is a mathematical operator so if you do not want to concatinate 2 integer type, make sure that you first concatinate with string variable. Example (2+ " " +2)