
Computer Exam Java Interview Questions
Q1. Java was developed by
A. Apple
B. IBM
C. Ericsson
D. Sun Microsystems
Show Answer
Answer:-D. Sun MicrosystemsQ 2. In which year Java programming language was developed
A. 1991
B. 1993
C. 1995
D. 1996
Show Answer
Answer:-A. 1991Q 3. Which one was the initial name of Java
A. Oak
B. CDL
C. CS-4
D. Usenet
Show Answer
Answer:-A. OakQ 4. Which one is correct — “java is a _________”
A. platform dependent language
B. platform independent language
C. OS dependent language
D. OS independent language
Show Answer
Answer:-B. platform independent languageQ 5. A special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser is
A. Servlets
B. JSP
C. Applet
D. Bytecode
Show Answer
Answer:-C. AppletQ 6. Java is a
A. Static language
B. Dynamic language
C. Assembly language
D. Binary language
Show Answer
Answer:-B. Dynamic languageQ 7. A highly optimized set of instructions designed to be executed by the Java run-time system, is called
A. Objectcode
B. Bitcode
C. Bytecode
D. Floatcode
Show Answer
Answer:-C. BytecodeQ 8. Which one is commonly used to extend the applications hosted by web servers
A. JSP
B. IDE
C. Applet
D. Servlet
Show Answer
Answer:-D. ServletQ 9. Java is a _____________
A. Logic-based language
B. Stack-based language
C. Data-structured language
D. Object oriented programming language
Show Answer
Answer:-D. Object oriented programming languageQ 10. The act of representing essential features without including the background details or explanations is called
A. Abstraction
B. Polymorphism
C. Encapsulation
D. Inheritance
Show Answer
Answer:-A. AbstractionQ 11. Name of the process by which objects of one class acquire the properties of objects of another is called
A. Information Hiding
B. Inheritance
C. Polymorphism
D. Encapsulation
Show Answer
Answer:-B. InheritanceQ 12. Dynamic binding calls at
A. Start time
B. Compile time
C. Run time
D. Execution time
Show Answer
Answer:-C. Run timeQ 13. Static binding calls at
A. Start time
B. Compile time
C. Process time
D. Execution time
Show Answer
Answer:-B. Compile timeQ 14. Which one was the first browser to support Java applets
A. Internet Explorer
B. Safari
C. HotJava
D. NetJava
Show Answer
Answer:-C. HotJavaQ15. Which one is not a Java Comment type
A. Single line comment
B. Two line comment
C. Multi line comment
D. Documentation comment
Show Answer
Answer:-B. Two line commentQ 16. HotJava Browser was developed in the year
A. 1990
B. 1992
C. 1995
D. 1996
Show Answer
Answer:-C. 1995Q 17. 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 @/
Show Answer
Answer:-B. begin with /* and end with */Q 18. Which of the following is a single line comment syntax
A. / comment
B. // comment
C. /* comment */
D. //* comment */
Show Answer
Answer:-B. // commentQ 19. Which one is not a java access modifiers
A. Private
B. Default
C. Protected
D. Abstract
Show Answer
Answer:-D. AbstractQ 20. Access modifier which is accessible only within class is called
A. Private
B. Default
C. Protected
D. Public Answer: (a) Private
Show Answer
Answer:-A. PrivateQ 21. The protected access modifier is accessible within package and outside the package but through __________ only
A. Encasulation
B. Abstraction
C. Inheritance
D. Polymorphism
Show Answer
Answer:-C. InheritanceQ 22. The protected access modifier can be applied on
A. Members
B. Class
C. Method
D. Interface
Show Answer
Answer:-A. MembersQ 23. Which one is a correct if statement
A. if{condition} (statement)
B. if condition {statement}
C. if(condition) {statement}
D. if{condition} statement
Show Answer
Answer:-C. if(condition) {statement}Q 24. A loop in java ends with
A. Colon
B. Semicolon
C. Dot
D. Slash
Show Answer
Answer:-B. SemicolonQ25. Exit for loop is an example of
A. Do while loop
B. While loop
C. For loop
D. None of the above
Show Answer
Answer:-A. Do while loopQ 26. Which one loop is also known as Entry Control loop
A. Infinite loop
B. Do while loop
C. For loop
D. While loop
Show Answer
Answer:-D. While loopQ 27. 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
Show Answer
Answer:-C. –32,768 to 32,767Q 28. A Signed 64-bit type is named as
A. Byte
B. Short
C. Int
D. Long
Show Answer
Answer:-D. LongQ 29. Float has _____ bits of storage
A. 16
B. 32
C. 64
D. 128
Show Answer
Answer:-B. 32Q 30. 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
Show Answer
Answer:-B. 1.4e–045 to 3.4e+038Q 31. For storing a value, double uses
A. 24 bit
B. 32 bit
C. 64 bit
D. 128 bit
Show Answer
Answer:-C. 64 bitQ 32. Approximate range of double is
A. 4.9e–324 to 1.8e+308
B. 1.4e-045 to 3.4e+038
C. -2147483648 to + 2147483647
D. 0 to 65535
Show Answer
Answer:-A. 4.9e–324 to 1.8e+308Q 33. For logical value, which primitive type is used
A. Float
B. Long
C. Double
D. Boolean
Show Answer
Answer:-D. BooleanQ 34. Which of the following is intrinsic data type
A. Classes
B. Arrays
C. Integer
D. Interface
Show Answer
Answer:-C. IntegerQ 35. Which of the following is derived data type
A. Floating point
B. Interface
C. Character
D. Boolean
Show Answer
Answer:-B. InterfaceQ 36. Assigning a value of one type to a variable of another type is known as
A. Type compression
B. Type casting
C. Type correction
D. Type inheritance
Show Answer
Answer:-B. Type castingQ 37. The syntax “type variable = (type) variable2” is used for
A. Type casting
B. Type compression
C. Type inheritance
D. Type correction
Show Answer
Answer:-A. Type castingQ 38. Which type of conversions do not lose information about the magnitude of a value
A. String
B. Capture
C. Narrowing
D. Widening
Show Answer
Answer:-D. WideningQ 39. Assigning a larger type to a smaller one is known as _________ conversion in Java
A. Identity
B. Narrowing
C. Boxing
D. Capture
Show Answer
Answer:-B. NarrowingQ40. What is the default value of int
A. 0.0F
B. 0L
C. 0
D. 1
Show Answer
Answer:-C. 0Q 41. What is the default value of boolean in java
A. True
B. False
C. Null
D. 0.0d
Show Answer
Answer:-B. FalseQ 42. What are typically used to store information in Java
A. Variables
B. Constant
C. Conversion
D. None of the above
Show Answer
Answer:-A. VariablesQ 43. Which of the variables serve as symbolic constants
A. Boolean
B. Char
C. Float
D. Final
Show Answer
Answer:-D. FinalQ 44. Arithmetic operators in java can not be applied to
A. Long
B. Char
C. Float
D. Boolean
Show Answer
Answer:-D. BooleanQ 45. Java has a distinction of supporting special operators known as
A. Bitwise operators
B. Unary Operators
C. Conditional Operators
D. Type Comparison Operator
Show Answer
Answer:-A. Bitwise operatorsQ 46. The operator sign ‘|’ is used for Bitwise ______
A. AND
B. OR
C. XOR
D. Complement
Show Answer
Answer:-B. ORQ 47. Which of the following operator has higher precedence
A. +
B. –
C. *
D. ||
Show Answer
Answer:-C. *Q 48. When a=9, b=12, c=3 then output of following statement is: x = a-b/3+c*2-1
A. 8
B. 10
C. 12
D. 15
Show Answer
Answer:-B. 10Q 49. Unary minus ‘-‘ has associativity from
A. Right to left
B. Left to right
C. Not associative
D. None of the above
Show Answer
Answer:-A. Right to leftQ50. Which one returns the smallest whole number greater than or equal to x is
A. rint(x)
B. sqrt(x)
C. log(x)
D. ceil(x)
Leave a Reply