100 Important Java MCQ (MCQs Online Test)
Java MCQ – Java MCQ with Answers -All these are very important Java MCQ (Multiple choice) questions and answers for the students and professionals to get success in any written exam as well as interview exam which want to check the knowledge of Java.
Java MCQ set 1
Q 1. Which of the following is a run time entity?
- Program
- Object
- Both 1 and 2
- None of these
Answer 3
Q 2. Which of the following is a real time entity?
- Class
- Object
- Method
- None
Answer 2
Q 3. Which of the following makes inheritance compulsory?
- Final
- Abstract
- Protected
- None
Answer 2
Q 4. Combining data and method together is called
- Encapsulation
- Classification
- Data hiding
- None
Answer 1
Q 5. Which of the following allows fixed length of strings?
- Final
- String
- StringBuffer
- None
Answer 2
Q 6. Which of the following group classes and interfaces together in java?
- Package
- Library
- Inheritance
- Directories
Answer 1
Q 7. Which of the following keyword is used to initialize an object?
- new
- main
- init
- None
Answer 1
Q 8. Which of the following type of inheritance is not allowed in java?
- Multilevel
- Multiple
- Hierarchical
- None
Answer 2
Q 9. Which of the following works differently despite of same name?
- Method overloading
- Method overriding
- Dynamic binding
- None
Answer 1
Q 10. Which of the following modifier is used in inheritance?
- Super
- Protected
- Method overriding
- None
Answer 2
Q 1. Which of the following method blocks a thread for a specific time?
- sleep()
- wait()
- suspend()
- stop()
Answer 1
Q 2. Which of the following prevents inheritance?
- Abstract
- Public
- Final
- Protected
Answer 3
Q 3. Hiding low level details is called
- Abstraction
- Polymorphsim
- Encapsulation
- Data hiding
Answer 1
Q 4. Which of the following allows variable length of strings?
- String
- StringBuffer
- Array
- None
Answer 2
Q 5. Which of the following allows re-usability in java?
- Inheritance
- Package
- Both 1 and 2
- None
Answer 3
Q 6. Which of the following allows selecting from multiple choices?
- Switch
- If else
- Conditional operator
- None
Answer 1
Q 7. Which of the following type of inheritance is replaced by interface in java?
- Single
- Multiple
- Multilevel
- Hierarchical
Answer 2
Q 8. Which of the following works in Inheritance?
- Dynamic binding
- Method overloading
- Method overriding
- Data hiding
Answer 3
Q 9. Method and data are combined into —–
- Classification
- Polymorphsim
- Encapsulation
- None
Answer 1
Q 10. Which of the following is not used in inheritance?
- Method overriding
- Private
- Protected
- None
Answer 2
Java MCQ set 3
Q 11. Which of the following generate an exceptional?
- Try
- Catch
- Throw
- Throws
Answer 1
Q 12. Which one of the following package supports system.println?
- java.io
- java.util
- java.lang
- None
Answer 1
Q 13. Which of the following method blocks a thread until a condition satisfy?
- wait()
- sleep()
- stop()
- suspend()
Answer 1
Q 14. Which of the following start a thread?
- start
- new
- Thread class
- None
Answer 3
Q 15. Which of the following catch an exception?
- try
- catch
- throw
- finally
Answer 2
Q 16. Which of the following is an optional block?
- final
- finally
- finalize
- None
Answer 2
Q 17. Which of the following de-initialize an object in java?
- destructor
- finalize
- new
- flush
Answer 2
Q 18. Which of the following kind of error are not handled by exception handling routine?
- Syntax
- Compile time
- Both 1 and 2
- None
Answer 3
Q 19. Which of the following is a light weight process?
- Applet
- Thread
- Process
- Servlet
Answer 2
Q 20. Which of the following package support Exception handling?
- java.io
- java.lang
- java.util
- None
Answer 1
Java MCQ set 4
Q 21. Which of the following support layout in GUI?
- java.gui
- java.io
- java.lang
- java.awt
Answer 4
Q 22. Which of the following is used to inherit a class?
- import
- inherits
- extends
- None
Answer 3
Q 23. Which of the following keyword is used to create a file?
- write
- read
- open
- None
Answer 1
Q 24. Which of the following method is used to open a file?
- read
- open
- write
- None
Answer 2
Q 25. Character stream classes are used to read and write —-
- 8 bit of data
- 16 bit of data
- 32 bit of data
- None
Answer 2
Q 26. Which of the following are unidirectional?
- bit stream
- byte stream
- character stream
- None
Answer 2
Q 27. Which of the following are supported by Java?
- TCP
- UDP
- Both 1 and 2
- None
Answer 3
Q 28. All the computers in the internet using TCP/IP communicate through the —-
- Port
- Socket
- IP protocol
- None
Answer 2
Q 29. Which of the following connection less protocol?
- TCP
- UDP
- IP Protocol
- None
Answer 2
Q 30. Ports are represented by —- bit numbers.
- 16
- 32
- 8
- None
Answer 1
Java MCQ set 5
Q 31. Which of the following package supports Layouts?
- java.net
- java.awt
- java.graphics
- None
Answer 2
Q 32. IP address consists of series of four —- bits numbers
- 8
- 16
- 32
- None
Answer 1
Q 33. Which of the following create a dynamic array in the java applications?
- ArrayList
- Array
- String
- None
Answer 1
Q 34. Which of the following class in java is used to break a string into tokens?
- String
- StringBuffer
- StringTokenizer
- None
Answer 3
Q 35. Date class is available in ———-
- java.lang
- java.util
- java.io
- java.awt
Answer 2
Q 36. Which of the following interface is used to sort the elements of a collection in the ascending order?
- Array
- List
- SortedSet
- None
Answer 3
Q 37. Which of the following returns the first element from the SortedSet?
- top()
- first()
- one()
- None
Answer 2
Q 38. Which of the following returns the last element from the SortedSet?
- last()
- end()
- isLast()
- None
Answer 1
Q 39. Which of the following interface allows accessing and traversing the elements of the collection in a sequential order.?
- Iterator
- Array
- List
- None
Answer 1
Q 40. Which of the following removes current element from the collection?
- delete()
- remove()
- erase()
- None
Answer 2
Java MCQ set 6
Q 41. Which of the following package support collections?
- java.util
- java.lang
- java.io
- java.awt
Answer 1
Q. 42. Which of the following allows storing, access and updating set of objects?
- Collection
- Array
- String
- None
Answer 1
Q 43. Which of the following returns true if the object is added to the specified collection?
- add(object o)
- append(object o)
- insert(object o)
- adds(object o)
Answer 1
Q. 44. Which of the following removes all the objects from a given collection?
- delete()
- clear()
- clears()
- None
Answer 2
Q. 45. Which of the following returns true if entire objects of a collection are added in the specified collection?
- addAll(collection c)
- add(collection c)
- append(collection c)
- None
Answer 1
Q. 46. Which of the following return true if the collection contains the specified element?
- contains(object o)
- contains(object)
- contain(object o)
- None
Answer 1
Q. 46. Which of the following returns true if the collection is empty?
- Empty()
- isEmpty()
- isVacant()
- None
Answer 2
Q. 47. Which of the following returns the number of objects present in the collection?
- length()
- len()
- size()
- None
Answer 3
Q. 48. Which of the following returns an array containing all the elements in a collection?
- toArray()
- allArray()
- array()
- None
Answer 1
Q. 49. Which of the following package support network programming?
- java.util
- java.net
- java.awt
- None
Answer 2
Q. 50. Resource name is the component of —-
- Uniform resource locator
- Port
- IP Protocol
- None
Answer 1
Java mcq are selected from question papers of various exams to support the students. These java mcq covers all the important questions of core java.
Suggestion for improvement are always welcome. Kindly write in the comment box for your valuable suggestions