πŸ“Š JAVA
Q. What is the value of the expression 8 << 2 ?
  • (A) 2
  • (B) 32
  • (C) 1 6
  • (D) 5
πŸ’¬ Discuss
βœ… Correct Answer: (B) 32
πŸ“Š JAVA
Q. The keyword used to create a constant variable
  • (A) const
  • (B) static
  • (C) final
  • (D) none of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) final
πŸ“Š JAVA
Q. What is stored in the object obj in following lines of code? box obj;
  • (A) Memory address of allocated memory of object.
  • (B) NULL
  • (C) Any arbitrary pointer
  • (D) Garbage
πŸ’¬ Discuss
βœ… Correct Answer: (B) NULL
πŸ“Š JAVA
Q. Which of the following is a valid declaration of an object of class Box?
  • (A) Box obj = new Box();
  • (B) Box obj = new Box;
  • (C) obj = new Box();
  • (D) new Box obj;
πŸ’¬ Discuss
βœ… Correct Answer: (A) Box obj = new Box();
πŸ“Š JAVA
Q. Name the keyword that makes a variable belong to a class, rather than being defined for each instance of the class.
  • (A) static
  • (B) final
  • (C) abstract
  • (D) public
πŸ’¬ Discuss
βœ… Correct Answer: (A) static
πŸ“Š JAVA
Q. Variables declared with in a class are called
  • (A) Identifier
  • (B) local variable
  • (C) instance variable
  • (D) global variable
πŸ’¬ Discuss
βœ… Correct Answer: (C) instance variable
πŸ“Š JAVA
Q. Variables declared within a method or block are called
  • (A) Static variable
  • (B) local variable
  • (C) instance variable
  • (D) global variable
πŸ’¬ Discuss
βœ… Correct Answer: (B) local variable
πŸ“Š JAVA
Q. Defining methods with same name and different no. of parameters are called
  • (A) Method overriding
  • (B) method overloading
  • (C) Dynamic method dispatch
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) method overloading
πŸ“Š JAVA
Q. _________ is used to initialize objects.
  • (A) Methods
  • (B) arguments
  • (C) constructors
  • (D) new keyword
πŸ’¬ Discuss
βœ… Correct Answer: (C) constructors
πŸ“Š JAVA
Q. What is the return type of Constructors?
  • (A) int
  • (B) float
  • (C) void
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the mentioned