Introduction to Java
Jim White
Java Developer
String
Components:
String
keywordString variableName
Components:
String
keywordString variableName =
Components:
String
keyword=
to assign valueString variableName = "text in double quotation marks";
Components:
String
keyword=
to assign value;
// Example
String message = "Hello, Java!";
int
for whole numbersint age = 29;
class InfoAboutJava {
public static void main(String[] args) {
String message = "Java is awesome!";
// Print the message variable
System.out.println(message);
}
}
Java is awesome!
type variableName = value;
Use variables instead of their value
class InfoAboutJava {
public static void main(String[] args) {
String message = "Java is awesome!";
// Using variable directly
System.out.println(message);
}
}
Introduction to Java