πŸ“Š JAVA
Q. Which of these can not be used for a variable name in Java?
  • (A) identifier
  • (B) keyword
  • (C) identifier & keyword
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) keyword
πŸ“Š JAVA
Q. Which of the below is invalid identifier with the main method?
  • (A) public
  • (B) static
  • (C) private
  • (D) final
πŸ’¬ Discuss
βœ… Correct Answer: (C) private
πŸ“Š JAVA
Q. If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?
  • (A) long
  • (B) int
  • (C) double
  • (D) float
πŸ’¬ Discuss
βœ… Correct Answer: (C) double
πŸ“Š JAVA
Q. Which of these data type can be used for a method having a return statement in it?
  • (A) void
  • (B) int
  • (C) float
  • (D) both int and float
πŸ’¬ Discuss
βœ… Correct Answer: (D) both int and float
πŸ“Š JAVA
Q. Which of these is the method which is executed first before execution of any other thing takes place in a program?
  • (A) main method
  • (B) finalize method
  • (C) static method
  • (D) private method
πŸ’¬ Discuss
βœ… Correct Answer: (C) static method
πŸ“Š JAVA
Q. Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?
  • (A) break
  • (B) return
  • (C) exit
  • (D) continue
πŸ’¬ Discuss
βœ… Correct Answer: (D) continue
πŸ“Š JAVA
Q. What is the return type of a method that does not return any value?
  • (A) int
  • (B) float
  • (C) void
  • (D) double
πŸ’¬ Discuss
βœ… Correct Answer: (C) void
πŸ“Š JAVA
Q. Which keyword is used by the method to refer to the object that invoked it?
  • (A) import
  • (B) catch
  • (C) abstract
  • (D) this
πŸ’¬ Discuss
βœ… Correct Answer: (D) this
πŸ“Š JAVA
Q. Which of these method(s) is/are used for writing bytes to an outputstream?
  • (A) put()
  • (B) print() and write()
  • (C) printf()
  • (D) write() and read()
πŸ’¬ Discuss
βœ… Correct Answer: (B) print() and write()
πŸ“Š JAVA
Q. What is the string contained in s after following lines of code?
Code:
StringBuffer s new StringBuffer("Hello"); s.deleteCharAt(0);
  • (A) Hell
  • (B) ello
  • (C) Hel
  • (D) llo
πŸ’¬ Discuss
βœ… Correct Answer: (B) ello