Java Programming MCQ Questions and Answers | Java MCQ Test Question Papers for the preparation of academic and competitive exams
Java Programming MCQ Questions and Answers
1. Java handles all input and output in the form of ___.
2. The two basic streams used are the ___ and the ___ streams.
Ans. Input, Output.
3. ___ are used to read data from one stream and write it to another stream.
4. ___ provide the capability of placing “bookmarks” on the stream and resetting it.
Ans. Markable Streams.
5. ___ method writes the specified byte of data to the output stream.
Ans. void write(int n).
6. ___ and ___ streams are classified as mode streams as they read and write data from disk files.
Ans. FileInputStream, FileOutputStream.
7. The ___ and ___ classes are the filter streams that allow the reading and writing of Java primitive data types.
Ans. DataInputStream, DataOutputStream.
8. The ___ and ___ classes are abstract classes that support the reading and writing of Unicode character streams.
Ans. Reader, Writer.
9. Unicode is used to represent data such that each character is represented by ___.
Ans. 16 bits.
10. The most important subclasses of the Reader and Writer classes are ___ and ___.
Ans. InputStreamReader, OutputStreamWriter.
11. Java provides the ___ class to perform I/O operations at specified locations within a file.
12. The RandomAccessFile class implements the ___and ___ interfaces.
Ans. DataInput, DataOutput.
13. The capability of an object to exist beyond the execution of the program that created is known as___.
14. ___ is the key to implement persistence.
15. Java programs written to run on World Wide Web (WWW) are called ___.
16. Applets can be tested using the ___ tool included in the Java Development Kit.
17. The Applet tag is written in the ___ tag of an HTML document.
18. Parameters can be sent to the applet using ___ tag.
19. The Graphics class is a part of the ___ package.
20. The ___ method draws the graphics of the applet in the drawing area.
21. When the user interacts with the application by pressing a key or clicking a mouse button, an ___ is generated.
22. The ___ class is at the top of the event class hierarchy.
23. When the user clicks on the button, the ___ event is generated.
24. An ___ event is generated by a scroll bar.
25. An ___ event is generated when an item from a list, a choice, or a check box is selected.
26. AWT stands for ___.
Ans. Abstract Windowing Toolkit
27. ___ defines how the components will be arranged in a container.
Ans. Layout Manager
28. ___ class represents Swing tree objects used to display hierarchical data in a user interface.
29. The libraries of JFC used for a swing for assistive technologies is ___.
Ans. Swing API
30. Accessibility API is one of the constituents of JFC used for assisting ___.
Ans. People with disabilities
31. ___ provides advanced capabilities for working with shapes, text, and images.
32. ___ package provides models and views for the table component with an appearance similar to a spreadsheet.
33. ___ package is used.to define several new listeners and events that Swing components use to communicate asynchronous information between classes
34. Swing component relies on an ___ container.
35. Swing Component that can be used for menu items to represent mutually exclusive items for selecting only one item at a time is ___.
36. JAVA API stands for ___.
Ans. Java DataBase Connectivity Application Program Interface
37. MS-Access stores the data in ___ file format whereas MS-SQL Server stores the data in a ___ file format.
Ans. MDB, .DAT
38. Give some examples for DBMS products.
Ans. MS-Access, SQL Server, MySQL, Oracle, Sybase etc.
39. <protocol> in a JDBC URL is always ___.
40. <subprotocol> in JDBC URL must be ___.
41. RMI stands for ___.
Ans. Remote Method Invocation
42. A ___ is a service that runs on a server and helps the objects on other hosts to remotely access its registered objects.
Ans. Remote Registry Server
43. Objects that are exported for remote access must implement the interface called ___.
Ans. remote interface.
44. All the methods that are to be invoked remotely must throw the exception called ___.
45. RMI uses the ___ protocol for transporting the information.
46. CORBA stands for Common ___.
Ans. Common Object Request Broker Architecture
47. IDL stands for ___.
Ans. Interface Definition Language
48. CORBA and the IDL mappings are the work of an industry consortium known as the___.
Ans. Object Management Group
49. The ___ is a very simple test container for JavaBeans.
50. A Bean obtains all the benefits of Java’s “___” paradigm.
Ans. write-once, run-anywhere.
51. The right-hand window of the bean box contains ___showing the properties for the currently selected bean.
52. ___ is used to identify the database in the JDBC URL.
53. A ___ is a collection of related information and a ___ is the software that provides you with a mechanism to manipulate data in the database.
Ans. Database, Database Management System (DBMS).
54. ___ is an abstract class that is used to create and control a connection to a platform- and firewall-specific location.
55. ___ is an abstract class that is used to create a format for opening a stream connection to a specific URL.
56. The ___ method is used to report that a thread has died.
57. ___ package contains all the network related classes and methods of Java.
58. ___ method opens a connection to an URL and enables to extract of data from that connection.
59. ___ class is used to read a stream of data that is generated by a network connection and produce an object.
60. Servlet Life Cycle contains ___, ___ and ___ methods.
Ans. init(), service(), destroy().
61. JSP stands for ___.
Ans. Java Server Pages
62. A ___ is a small pluggable extension to a server that enhances the server’s functionality.
63. CGI stands for ___.
Ans. Common Gateway Interface.
64. Middle tier of three-tier architecture contains ___. Ans. Application Logic
Download Java Programming MCQs for Test Exams
Thanks for your visit, if you like the post on Java Programming MCQ Questions and Answers, please share it on social media.