1/13
Udemy Course
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What command is used to compile a Java program/
javac ProgramName.java
After compiling a Java program, which file is generated?
.class
What command is used to run a compiles Java program?
java ProgramName
What happens if you try to run a Java program without compiling it first?
Java will give a “class not found” error
What is a valid identifier in Java?
variable_1?
What is the range of values for a byte data type in Java?
-128 to 127
What is the correct way to declare a constant in Java?
final int PI = 3.14;
What data type has the highest precision in Java?
double
What is the default value of a boolean variable in Java?
false
T/F: Java uses the Unicode character set to represent characters.
True
What is used to obtain the command-line arguments in Java?
String[] args
What is the output of this code:
public class Test {
public static void main(String[] args) {
System.out.println(args[0]);
}
}
Command-line input: java Test Hello
Hello
T/F: char letter = ‘AB’; is a valid declaration of a variable in Java
False
In Java, what will be the result of the following statement?
float f = 10/4;
2.0