Java Object Concepts Quiz
Java Object Concepts Quiz
- A) A collection of variables
- B) An instance of a class
- C) A method
- D) A data type
- B) A type of variable
- C) A method of an object
- B) A type of variable
- A) Defining multiple methods with the same name but different parameters
- A) Defining a method in a subclass that has the same name and parameters as a method in
the parent class
- B) A type of class
- A) `==` checks for reference equality, while `.equals()` checks for value equality
int num = 7;
A) Even
B) Odd
C) 7
D) None of the above
18. What will be printed by the following code?
str = str.toUpperCase();
System.out.println(str);
A) Java
B) JAVA
C) "Java"
D) None of the above
int x = 5;
x += 3;
System.out.println(x);
A) 5
B) 3
C) 8
D) None of the above
20. What will this code output?
int a = 10;
int b = 20;
A) 10
B) 20
C) a
D) None of the above