NEW
Font size
WorksheetsJava Displaying Data & Data Types
Total questions: 12
Worksheet time: 6mins
Which one is correct?
public static main(Strings[] args) { }
public private static main(Strings[] args) { }
public static void main(Strings[] args) { }
public void static main(Strings[] args) { }
How would you declare a variable that tells you that someone passed a class?
boolean passed = 'true';
boolean passed = true;
passed = true;
String passed = "true";
How would you declare a variable storing the tax rate?
int taxRate = 5.1;
taxRate = "5.1";
double taxRate = 5.1;
double taxRate = "5.1";
What data type would you use for storing the average test score in a class?
boolean
char
int
double
What data type would you use for storing the number of students in a class?
boolean
char
int
double
What data type would you use for storing the average test score in a class?
boolean
char
int
double
Name the data type: 1.0
double
int
char
boolean
This data type returns true or false
String
boolean
char
int
