Java Programming MCQ Questions and Answers | Java MCQ Test

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 ___.
Ans. Streams.

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.
Ans. Filters.

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.
Ans. RandomAccessFile.

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___.
Ans. Persistence

14. ___ is the key to implement persistence.
Ans. Serialization

15. Java programs written to run on World Wide Web (WWW) are called ___.
Ans. applets

16. Applets can be tested using the ___ tool included in the Java Development Kit.
Ans. appletviewer

17. The Applet tag is written in the ___ tag of an HTML document.
Ans. body

18. Parameters can be sent to the applet using ___ tag.
Ans. PARAM

19. The Graphics class is a part of the ___ package.
Ans. java.awt

20. The ___ method draws the graphics of the applet in the drawing area.
Ans. paint()

21. When the user interacts with the application by pressing a key or clicking a mouse button, an ___ is generated.
Ans. event

22. The ___ class is at the top of the event class hierarchy.
Ans. EventObject

23. When the user clicks on the button, the ___ event is generated.
Ans. ActiionEvent

24. An ___ event is generated by a scroll bar.
Ans. AdjustmentEvent

25. An ___ event is generated when an item from a list, a choice, or a check box is selected.
Ans. ItemEvent.

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.
Ans. JTree

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.
Ans. 2D-API

32. ___ package provides models and views for the table component with an appearance similar to a spreadsheet.
Ans. javax.swing.table

33. ___ package is used.to define several new listeners and events that Swing components use to communicate asynchronous information between classes
Ans. javax.swing.event

34. Swing component relies on an ___ container.
Ans. AWT

35. Swing Component that can be used for menu items to represent mutually exclusive items for selecting only one item at a time is ___.
Ans. JRadioButtonMenuItem

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 ___.
Ans. jdbc

40. <subprotocol> in JDBC URL must be ___.
Ans. odbc

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 ___.
Ans. RemoteException.

45. RMI uses the ___ protocol for transporting the information.
Ans. TCP

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.
Ans. BeanBox.

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.
Ans. PropertySheet.

52. ___ is used to identify the database in the JDBC URL.
Ans. <subname>

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.
Ans. URLConnection

55. ___ is an abstract class that is used to create a format for opening a stream connection to a specific URL.
Ans. URLStreamHandler

56. The ___ method is used to report that a thread has died.
Ans. threadDeathEvent()

57. ___ package contains all the network related classes and methods of Java.
Ans. java.net

58. ___ method opens a connection to an URL and enables to extract of data from that connection.
Ans. getInputStream()

59. ___ class is used to read a stream of data that is generated by a network connection and produce an object.
Ans. ContentHandler()

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.
Ans. Servlet.

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.

Java Programming MCQs Sample Question Paper – I

Share on Social Media

Similar Posts

One Comment

  1. It’s very informative and it has helped me in my exam

Leave a Reply

Your email address will not be published. Required fields are marked *