Java Interview Questions
Q16. HotJava Browser was developed in the year
(a) 1990
(b) 1992
(c) 1995
(d) 1996
Answer: (c) 1995
Q17. Which of the following is a multi line comment syntax
(a) begin with / and end with /
(b) begin with /* and end with */
(c) begin with # and end with #
(d) begin with /@ and end with @/
Answer: (b) begin with /* and end with */
Q18. Which of the following is a single line comment syntax
(a) / comment
(b) // comment
(c) /* comment */
(d) //* comment */
Answer: (b) // comment
Q19. Which one is not a java access modifiers
(a) Private
(b) Default
(c) Protected
(d) Abstract
Answer: (d) Abstract
Q20. Access modifier which is accessible only within class is called
(a) Private
(b) Default
(c) Protected
(d) Public
Answer: (a) Private
Q21. The protected access modifier is accessible within package and outside the package but through __________ only
(a) Encasulation
(b) Abstraction
(c) Inheritance
(d) Polymorphism
Answer: (c) Inheritance
Q22. The protected access modifier can be applied on
(a) Members
(b) Class
(c) Method
(d) Interface
Answer: (a) Members
Q23. Which one is a correct if statement
(a) if{condition} (statement)
(b) if condition {statement}
(c) if(condition) {statement}
(d) if{condition} statement
Answer: (c) if(condition) {statement}
Q24. A loop in java ends with
(a) Colon
(b) Semicolon
(c) Dot
(d) Slash
Answer: (b) Semicolon
Q25. Exit for loop is an example of
(a) Do while loop
(b) While loop
(c) For loop
(d) None of the above
Answer: (a) Do while loop
Q26. Which one loop is also known as Entry Control loop
(a) Infinite loop
(b) Do while loop
(c) For loop
(d) While loop
Answer: (d) While loop
Q27. The range of Short is
(a) –27,568 to 27,567
(b) –30,453 to 30,453
(c) –32,768 to 32,767
(d) –34,563 to 34,563
Answer: (c) –32,768 to 32,767
Q28. A Signed 64-bit type is named as
(a) Byte
(b) Short
(c) Int
(d) Long
Answer: (d) Long
Q29. Float has _____ bits of storage
(a) 16
(b) 32
(c) 64
(d) 128
Answer: (b) 32
Q30. The range of floating point is
(a) -128 to +127
(b) 1.4e–045 to 3.4e+038
(c) -2147483648 to + 2147483647
(d) -32768 to + 32767
Answer: (b) 1.4e–045 to 3.4e+038
Practice Test Exam