Ajp MCQ Test For Diploma Students

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Sukeshini_Gawai
S
Sukeshini_Gawai
Community Contributor
Quizzes Created: 2 | Total Attempts: 6,817
Questions: 29 | Attempts: 6,178

SettingsSettingsSettings
Ajp MCQ Test For Diploma Students - Quiz


Questions and Answers
  • 1. 

      Give the abbreviation of AWT?

    • A.

      Applet Windowing Toolkit

    • B.

      Abstract Windowing Toolkit

    • C.

      Absolute Windowing Toolkit

    • D.

      None of the above

    Correct Answer
    B. Abstract Windowing Toolkit
    Explanation
    The correct answer is "Abstract Windowing Toolkit". AWT is a set of Java libraries that provide the foundation for creating graphical user interfaces (GUIs) in Java. It includes components such as buttons, menus, and text fields, as well as layout managers for organizing these components on a window. AWT is platform-independent, meaning that it can be used to create GUIs that run on different operating systems.

    Rate this question:

  • 2. 

    Which is the container that contain title bar and can have MenuBars. It can have other components like button, textfield etc.?

    • A.

      Panel

    • B.

      Frame

    • C.

      Window

    • D.

      Container

    Correct Answer
    B. Frame
    Explanation
    A Frame is a container that contains a title bar and can have MenuBars. It can also have other components like buttons and text fields.

    Rate this question:

  • 3. 

    The following specifies the advantages of It is lightweight. It supports pluggable look and feel. It follows MVC (Model View Controller) architecture.

    • A.

      Swing

    • B.

      AWT

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer
    A. Swing
    Explanation
    Swing is the correct answer because it has several advantages over AWT. It is lightweight, meaning it consumes less memory and is faster in performance. It supports pluggable look and feel, allowing developers to customize the appearance of their applications. It also follows the MVC architecture, which helps in separating the data, presentation, and logic components of an application. AWT, on the other hand, does not have these advantages, making Swing a better choice for developing graphical user interfaces.

    Rate this question:

  • 4. 

    The Following steps are required to perform 1) Implement the Listener interface and overrides its methods 2) Register the component with the Listener

    • A.

      Exception Handling

    • B.

      String Handling

    • C.

      Event Handling

    • D.

      None of the above

    Correct Answer
    C. Event Handling
    Explanation
    The given steps describe the process of implementing event handling in a program. In event handling, the Listener interface is implemented and its methods are overridden to define the desired behavior when an event occurs. The component that needs to handle the event is then registered with the Listener. This allows the program to respond to events and perform the necessary actions based on the event. Therefore, the correct answer is Event Handling.

    Rate this question:

  • 5. 

    Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfield etc?

    • A.

      Window

    • B.

      Frame

    • C.

      Panel

    • D.

      Container

    Correct Answer
    C. Panel
    Explanation
    A Panel is a container that does not contain a title bar and menu bars, but it can have other components like buttons and text fields. Panels are often used to group related components together and provide a way to organize and layout the components within a larger container, such as a window or frame.

    Rate this question:

  • 6. 

    Which method is used to set the graphics current color to the specified color in the graphics class?

    • A.

      Public abstract void setFont(Font font)

    • B.

      Public abstract void setColor(Color c)

    • C.

      Public abstract void drawString(String str, int x, int y)

    • D.

      None of the above

    Correct Answer
    B. Public abstract void setColor(Color c)
    Explanation
    The correct answer is "public abstract void setColor(Color c)". This method is used to set the graphics current color to the specified color in the graphics class. It takes a Color object as a parameter and sets the current color to that specified color. This allows the programmer to change the color of the graphics being drawn on the screen.

    Rate this question:

  • 7. 

    Which class is used for this Processing Method processActionEvent( )?

    • A.

      Button,List,MenuItem

    • B.

      Button,Checkbox,Choice

    • C.

      Scrollbar,Component,Button

    • D.

      None of the above

    Correct Answer
    A. Button,List,MenuItem
    Explanation
    The correct answer is Button, List, MenuItem. These classes are used for the Processing Method processActionEvent(). The processActionEvent() method is used to handle action events generated by these components.

    Rate this question:

  • 8. 

    The Swing Component classes that are used in Encapsulates a mutually exclusive set of buttons?

    • A.

      AbstractButton

    • B.

      ButtonGroup

    • C.

      JButton

    • D.

      ImageIcon

    Correct Answer
    B. ButtonGroup
    Explanation
    ButtonGroup is the correct answer because it is a Swing component class that is used to encapsulate a mutually exclusive set of buttons. It allows only one button to be selected at a time within the group, providing a way to create radio button-like behavior for a set of buttons. This class is often used in situations where the user needs to choose only one option from a group of options.

    Rate this question:

  • 9. 

    The following way is used to create a frame is by creating the object of Frame class?

    • A.

      inheritance

    • B.

      Association

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer
    B. Association
    Explanation
    The correct answer is association because creating an object of the Frame class is a form of association. In object-oriented programming, association represents a relationship between two or more classes where each class has its own existence and can exist independently. In this case, the Frame class is associated with the object that is created from it, allowing the object to have its own properties and behaviors.

    Rate this question:

  • 10. 

     Which are the techniques for defining the structure of a specific type of XML documents?

    • A.

      Schema

    • B.

      DTD

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer(s)
    A. Schema
    C. Both A & B
    Explanation
    The correct answer is "Schema, Both A & B." This is because both Schema and DTD are techniques used for defining the structure of XML documents. Schema is a more modern and flexible approach, while DTD (Document Type Definition) is an older and more rigid method. Therefore, both options A (Schema) and B (DTD) are valid techniques for defining the structure of XML documents.

    Rate this question:

  • 11. 

    Implement the Listener interface and overrides its methods is required to perform in event handling?

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    To perform event handling, it is necessary to implement the Listener interface and override its methods. The Listener interface provides a set of methods that need to be implemented in order to handle events. By implementing this interface and overriding its methods, the necessary code can be written to respond to specific events when they occur. Therefore, the correct answer is True.

    Rate this question:

  • 12. 

    Which object can be constructed to show any number of choices in the visible window?

    • A.

      Labels

    • B.

      Choice

    • C.

      List

    • D.

      Checkbox

    Correct Answer
    C. List
    Explanation
    A "List" object can be constructed to show any number of choices in the visible window. Lists are designed to display multiple items or options that users can select from, and they can be configured to show a scrollable list if there are more choices than can fit in the visible area. Labels, Choices (drop-down menus), and Checkboxes have different uses and typically display a limited number of options at a time.

    Rate this question:

  • 13. 

    Which is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions?

    • A.

      Window

    • B.

      Panel

    • C.

      Frame

    • D.

      Container

    Correct Answer
    C. Frame
    Explanation
    A frame is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions. It is a component in a graphical user interface (GUI) that acts as a container for other components. Frames provide a way to organize and display multiple components within a window. They are commonly used in applications to create the main window or the top-level container.

    Rate this question:

  • 14. 

    The setBackground() method is part of the following class in java.awt package:

    • A.

      Applet

    • B.

      Graphics

    • C.

      Component

    • D.

      Container

    Correct Answer
    B. GrapHics
    Explanation
    The setBackground() method is part of the Graphics class in the java.awt package. This method is used to set the background color of a graphical component or container. By calling this method, we can change the background color of a graphic object or a graphical user interface element to the specified color.

    Rate this question:

  • 15. 

    Which object of HttpSession can be used to view and manipulate information about a session?

    • A.

      Session identifier

    • B.

      Creation time

    • C.

      Last accessed time

    • D.

      All mentioned above

    Correct Answer
    D. All mentioned above
    Explanation
    The correct answer is "All mentioned above" because all of the mentioned objects in HttpSession can be used to view and manipulate information about a session. The session identifier is a unique identifier for each session, the creation time represents the time when the session was created, and the last accessed time indicates the most recent time the session was accessed. By using these objects, developers can easily manage and track session information.

    Rate this question:

  • 16. 

    Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?

    • A.

      Bean-managed transactions

    • B.

      Container-managed transactions

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer
    A. Bean-managed transactions
    Explanation
    In bean-managed transactions, the session bean is responsible for managing its own transactions. It can obtain the UserTransaction object via the EJBContext using the getUserTransaction() method to control the transaction boundaries explicitly. In container-managed transactions, the container handles the transaction management, and the session bean does not have direct access to the UserTransaction object. Therefore, the correct answer is Bean-managed transactions.

    Rate this question:

  • 17. 

    Connection Pooling Class manages no of user requests for connections to improve the performance.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Connection pooling is a technique used to improve the performance of applications that need to establish multiple database connections. The connection pooling class manages a pool of pre-established connections and assigns them to user requests as needed. By reusing connections instead of creating new ones for each request, the overhead of establishing a connection is reduced, resulting in improved performance. Therefore, the statement that the connection pooling class manages the number of user requests for connections to improve performance is true.

    Rate this question:

  • 18. 

    Which class provides stream to read binary data such as image etc. from the request object?

    • A.

      ServletOutputStream

    • B.

      ServltInputStream

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer
    B. ServltInputStream
    Explanation
    The correct answer is ServltInputStream. This class provides a stream to read binary data, such as images, from the request object in a servlet. The ServletInputStream class is used to read data from the client's request, and it is typically used when handling binary data or when the data needs to be processed in a specific way. The ServletOutputStream class, on the other hand, is used to write data to the response object. Therefore, the correct class to use for reading binary data from the request object is ServletInputStream.

    Rate this question:

  • 19. 

    The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Using the PreparedStatement interface in an application can result in faster performance because the query is compiled only once. This means that if the same query is executed multiple times, the database does not need to recompile it each time, leading to improved efficiency. PreparedStatement also allows for the use of parameterized queries, which can further optimize performance by reducing the need for query parsing and planning. Overall, using PreparedStatement can help enhance the speed and efficiency of an application's database operations.

    Rate this question:

  • 20. 

    Which type of validation we must implement the Validateable interface (or extend ActionSupport class) and provide the implementation of validate method?

    • A.

      By Input Validation

    • B.

      By Ajax Validation

    • C.

      By Custom Validation

    • D.

      None of the above

    Correct Answer
    C. By Custom Validation
    Explanation
    To implement the Validateable interface or extend the ActionSupport class and provide the implementation of the validate method, we must be using custom validation. This means that we want to define our own validation logic and rules for the input data. This allows us to have more control over the validation process and customize it according to our specific requirements.

    Rate this question:

  • 21. 

     An RMI Server is responsible for

    • A.

      Creating an instance of the remote object

    • B.

      Exporting the remote object

    • C.

      Binding the instance of the remote object to the RMI registry

    • D.

      All mentioned above

    Correct Answer
    D. All mentioned above
    Explanation
    An RMI Server is responsible for creating an instance of the remote object, exporting the remote object, and binding the instance of the remote object to the RMI registry. All of these tasks are necessary for the RMI Server to function properly and allow clients to access and interact with the remote object.

    Rate this question:

  • 22. 

     How many steps are used to connect any java application using JDBC?

    • A.

      4

    • B.

      5

    • C.

      3

    • D.

      6

    Correct Answer
    B. 5
    Explanation
    To connect any Java application using JDBC, typically five steps are involved. These steps include loading the JDBC driver, establishing a connection to the database, creating a statement object, executing SQL queries or updates, and finally closing the connection. These steps ensure that the Java application can interact with the database using JDBC effectively.

    Rate this question:

  • 23. 

     In the elements of Hibernate architecture is a factory of session and client of ConnectionProvider, It holds the second level cache (optional) of data is

    • A.

      Session

    • B.

      SessionFactory

    • C.

      Transaction

    • D.

      ConnectionProvider

    Correct Answer
    B. SessionFactory
    Explanation
    The correct answer is SessionFactory. In Hibernate architecture, SessionFactory is responsible for creating sessions and acts as a client of ConnectionProvider. It also holds the optional second level cache of data. The SessionFactory is a crucial component as it provides a thread-safe way to create and manage sessions, allowing efficient interaction with the database.

    Rate this question:

  • 24. 

    Which tag is used to execute java source code in JSP?

    • A.

      Declaration Tag

    • B.

      Expression tag

    • C.

      Scriptlet tag

    • D.

      None of the above

    Correct Answer
    C. Scriptlet tag
    Explanation
    The scriptlet tag is used to execute Java source code in JSP. It allows the embedding of Java code directly into the JSP page, which can be used to perform various operations and generate dynamic content. The code within the scriptlet tag is executed at the server-side during the rendering of the JSP page.

    Rate this question:

  • 25. 

    Which was the first most widely used programming interface for accessing relational databases and it offers the ability to connect all the databases on all the platforms.?

    • A.

      JDBC API

    • B.

      ODBC API

    • C.

      Both A & B

    • D.

      None of the above

    Correct Answer
    B. ODBC API
    Explanation
    ODBC API (Open Database Connectivity Application Programming Interface) was the first most widely used programming interface for accessing relational databases. It offers the ability to connect all databases on all platforms, making it a popular choice for developers. JDBC API (Java Database Connectivity Application Programming Interface) is also widely used, but it came after ODBC and is specific to Java programming language. Therefore, the correct answer is ODBC API.

    Rate this question:

  • 26. 

    Which method compares the given object to 'this' object?

    • A.

      Public boolean equals(Object obj)

    • B.

      Public final void notifyAll()

    • C.

      Public final void notify()

    • D.

      Public final ClassgetClass()

    Correct Answer
    A. Public boolean equals(Object obj)
    Explanation
    The method public boolean equals(Object obj) is used to compare the given object to the current object. It returns true if the objects are equal and false otherwise. This method is commonly used to compare objects for equality in Java.

    Rate this question:

  • 27. 

    Which methods are commonly used in ServerSocket class?

    • A.

      Public OutputStream getOutputStream()

    • B.

      Public Socket accept()

    • C.

      Public synchronized void close()

    • D.

      None of the above

    Correct Answer
    B. Public Socket accept()
    Explanation
    The correct answer is "public Socket accept()". This method is commonly used in the ServerSocket class to accept a connection from a client. It waits until a client connects to the server and returns a Socket object that represents the connection. This allows the server to establish communication with the client and exchange data. The other methods listed, getOutputStream() and close(), are not specific to the ServerSocket class and are used for different purposes.

    Rate this question:

  • 28. 

    Which constructor of DatagramSocket class is used to creates a datagram socket and binds it with the given Port Number?

    • A.

      DatagramSocket(int port)

    • B.

      DatagramSocket(int port, InetAddress address)

    • C.

      DatagramSocket()

    • D.

      None of the above

    Correct Answer
    B. DatagramSocket(int port, InetAddress address)
    Explanation
    The constructor DatagramSocket(int port, InetAddress address) is used to create a datagram socket and bind it with the given port number. This constructor allows the user to specify both the port number and the IP address of the local machine to which the socket should be bound. By using this constructor, the user can ensure that the socket is bound to the desired port number and IP address before any data transfer takes place.

    Rate this question:

  • 29. 

    Which is not a XML function?

    • A.

      Transport information

    • B.

      Style information

    • C.

      Store information

    • D.

      Structure information

    Correct Answer
    B. Style information
    Explanation
    The given options are all related to XML functions except for "Style information." XML functions typically involve manipulating or querying XML data, such as transporting, storing, or defining the structure of the data. However, "Style information" does not directly relate to XML functions as it refers to the presentation or formatting of the XML data, which is typically handled by CSS (Cascading Style Sheets) in web development.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 26, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 20, 2018
    Quiz Created by
    Sukeshini_Gawai
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.