Answers Latest Update Graded A+
What keyword is used to inherit a class in Java?
✔✔ `extends`
How do you create a subclass in Java?
✔✔ `class Subclass extends Superclass { }`
How do you define an interface in Java?
✔✔ Using the `interface` keyword.
What is the default value of a boolean variable in Java?
✔✔ false
How do you check if a number is negative in Java?
✔✔ `number < 0`
1
, What operator is used for logical AND in Java?
✔✔ `&&`
What operator is used for logical OR in Java?
✔✔ `||`
What will `System.out.println("Java".toUpperCase());` print?
✔✔ "JAVA"
How do you find the maximum of two numbers in Java?
✔✔ `Math.max(a, b);`
How do you generate a random number in Java?
✔✔ `Math.random();`
How do you check if a string contains another string in Java?
✔✔ `string.contains("text");`
2