Trivia Quiz On Distributed Computing In Java

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Vietha
V
Vietha
Community Contributor
Quizzes Created: 11 | Total Attempts: 9,898
| Attempts: 607
SettingsSettings
Please wait...
  • 1/65 Questions

    If an error occurs when creating a socket an IOException is thrown.

    • True
    • False
Please wait...
About This Quiz

Java is a programming language that is used by most of the techies. This language can be used in different platforms and is quite easy to understand, write, and debug when compared to others. Below is a trivia quiz that is designed to test your understanding of distributing computing in Java language. Give it a try and see if you get it!

Trivia Quiz On Distributed Computing In Java - Quiz

Quiz Preview

  • 2. 

    This is responsible for determining whether the component should react to any input events from input devices such as the keyboard or mouse.

    • View

    • Controller

    Correct Answer
    A. Controller
    Explanation
    The controller is responsible for determining whether the component should react to any input events from input devices such as the keyboard or mouse. It acts as the intermediary between the view and the model, receiving input from the user and updating the model accordingly. In this case, the controller decides how the component should respond to input events and triggers the appropriate actions or updates.

    Rate this question:

  • 3. 

    If the host does not exist,  the Constructor Socket(String host,int port); will throws .........

    • An UnknownHostException

    • An IOException

    Correct Answer
    A. An UnknownHostException
    Explanation
    The Constructor Socket(String host,int port); will throw an UnknownHostException if the host does not exist. This exception is thrown when the IP address of the host cannot be determined or if the host name is invalid. It indicates that the host is not recognized or cannot be reached, causing the connection to fail.

    Rate this question:

  • 4. 

     This supports a technology called 'pluggable-Look-And-Feel' where components can be displayed as on any operating system.

    • Windows

    • Mac OS X

    • GTK+

    • None

    Correct Answer(s)
    A. Windows
    A. Mac OS X
    A. GTK+
    Explanation
    This answer is correct because the statement mentions a technology called 'pluggable-Look-And-Feel' which allows components to be displayed as on any operating system. The options provided - Windows, Mac OS X, and GTK+ - are all operating systems that support this technology, allowing components to be displayed with their respective look and feel. The option "None" is incorrect as it does not support the mentioned technology.

    Rate this question:

  • 5. 

    This is a Component which lets the user to select a numberic value within a bounded range.

    • JRadioButton

    • JButton

    • JSlider

    • JPanel

    Correct Answer
    A. JSlider
    Explanation
    A JSlider is a component that allows the user to select a numeric value within a bounded range. It provides a graphical representation of the range with a draggable thumb that can be moved along the track to select a desired value. This makes it suitable for scenarios where the user needs to choose a value within a specific range, such as setting a volume level or selecting a value on a scale. JRadioButton, JButton, and JPanel are not specifically designed for selecting numeric values within a range, making JSlider the correct answer.

    Rate this question:

  • 6. 

    An Icon can be added as a corner component to the JScrollPane.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The statement is stating that it is possible to add an icon as a corner component to the JScrollPane. This means that users can customize the appearance of the scroll pane by adding an icon in one of the corners.

    Rate this question:

  • 7. 

    Which Statement is true?

    • JSlider sl; sl = new JSliDer(SwingConstant.VERTICAL,0,255,0);

    • JSlider sl; sl = new JSlider(SwingConstants.VERTICAL,0,255,0);

    • JSlider sl; sl = new JSlider(SwingConstant.VERTICAL,0,255,0);

    • JSlider sl; sl = new JSlider(Swingconstant.VERTICAL,0,255,0);

    Correct Answer
    A. JSlider sl; sl = new JSlider(SwingConstants.VERTICAL,0,255,0);
    Explanation
    The correct answer is "JSlider sl; sl = new JSlider(SwingConstants.VERTICAL,0,255,0);". This is the correct way to create a new JSlider object with the specified parameters. The SwingConstants.VERTICAL constant is used to set the orientation of the slider to vertical, and the values 0, 255, and 0 represent the minimum, maximum, and initial values of the slider respectively.

    Rate this question:

  • 8. 

    This method is used to add a vertically long component as the row header. the components scroll up and down when the vertical scrolling.

    • JScrollPane

    • JFC

    • Oracle

    Correct Answer(s)
    A. JScrollPane
    A. JFC
    A. Oracle
    Explanation
    The answer includes three terms: JScrollPane, JFC, and Oracle. JScrollPane is a method used to add a vertically long component as the row header. It allows components to scroll up and down when there is vertical scrolling. JFC stands for Java Foundation Classes, which is a set of GUI classes and components for building Java applications. Oracle is a multinational computer technology corporation that develops and provides the Java programming language.

    Rate this question:

  • 9. 

    Event handling of JTextField are:

    • AddFocusListener(new FocusListener(){ public void focusGained(FocusEvent fe){ } public void focusLost(FocusEvent ev){ } });

    • AddItemListenner(new ItemListenner(){ public void itemStateChanged(ItemEvent e){ } });

    Correct Answer
    A. AddFocusListener(new FocusListener(){ public void focusGained(FocusEvent fe){ } public void focusLost(FocusEvent ev){ } });
    Explanation
    The correct answer is "addFocusListener(new FocusListener(){ public void focusGained(FocusEvent fe){ } public void focusLost(FocusEvent ev){ } });". This is the correct answer because it shows the correct syntax for adding a focus listener to a JTextField. The focus listener is used to handle events when the JTextField gains or loses focus. The code provided correctly implements the focusGained and focusLost methods, which will be executed when the corresponding events occur.

    Rate this question:

  • 10. 

    This is a protocol that sends independent package of data, called datagrams, from one computer to another with no quarantee about its transmission. it is not connect - based protocol.

    • TCP

    • UDP

    Correct Answer
    A. UDP
    Explanation
    UDP (User Datagram Protocol) is a protocol that sends independent packets of data, called datagrams, from one computer to another with no guarantee of its transmission. Unlike TCP (Transmission Control Protocol), UDP is not a connection-based protocol. It is commonly used for applications that require fast and efficient transmission of data, such as streaming media, online gaming, and DNS (Domain Name System) queries. UDP does not provide error checking or retransmission of lost packets, making it less reliable but faster than TCP.

    Rate this question:

  • 11. 

    These components do not have their peer-components equivalent as compared to AWT components.

    • LightWeight Components

    • Container Components

    Correct Answer
    A. LightWeight Components
    Explanation
    Lightweight components refer to the components in Swing, which is a successor to AWT. These components do not have their peer-components equivalent in AWT. In AWT, the components are heavyweight, meaning they are dependent on the underlying operating system's windowing system. On the other hand, Swing components are lightweight, as they are rendered entirely by Java code. Therefore, the given answer is correct in stating that lightweight components do not have their peer-components equivalent in AWT.

    Rate this question:

  • 12. 

    Any valid number, uses Character.isDigit.  in MaskFormatter class

    • #

    • $

    • *

    Correct Answer
    A. #
    Explanation
    The correct answer is "#". In the given question, it is stated that any valid number uses the Character.isDigit() method in the MaskFormatter class. The "#" symbol is commonly used in formatting patterns to represent any digit. Therefore, the answer "#" is correct as it represents a valid number in the context of the question.

    Rate this question:

  • 13. 

    This is used to create a GUI-based application. It is available in the javax.swing package.

    • JFrame

    • JApplet

    • JPanel

    Correct Answer
    A. JFrame
    Explanation
    JFrame is the correct answer because it is a class in the javax.swing package that is used to create a GUI-based application. It provides a window for the application and contains various methods and components for creating a graphical user interface. JFrame is commonly used as the main container for GUI applications and allows developers to add and arrange other components such as buttons, labels, and text fields.

    Rate this question:

  • 14. 

    Which statement is true?

    • JSlider SL; ............. SL.addChangeListener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ // ction Code; } });

    • JSlider SL; ............. SL.addChangeListener(new ChangeListener(){ public void statechanged(ChangeEvent e){ // ction Code; } });

    • JSlider SL; ............. SL.addChangelistener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ // ction Code; } });

    • JSlider SL; ............. SL.addChangeListener(new ChangeListener(){ public void stateChanged(Changeevent e){ // ction Code; } });

    Correct Answer
    A. JSlider SL; ............. SL.addChangeListener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ // ction Code; } });
    Explanation
    The correct answer is the first option: JSlider SL; SL.addChangeListener(new ChangeListener(){ public void stateChanged(ChangeEvent e){ // ction Code; } }); The reason this is the correct answer is because it correctly uses the addChangeListener() method to add a ChangeListener to the JSlider component. The ChangeListener is implemented as an anonymous inner class, and the stateChanged() method is overridden to define the desired action code. The other options either have incorrect method names (statechanged() instead of stateChanged()) or incorrect parameter names (Changeevent instead of ChangeEvent), which would result in compilation errors.

    Rate this question:

  • 15. 

    If you have a slider with the range 0 to 20 and major tick spacing set to 10, then you you will get at 0,10, and 20. So that Method is:

    • Public void setMinorTickSpacing(int spacing)

    • Public void setMajorTickSpacing(int spacing)

    • Public void setSnapToTicks(boolean set)

    Correct Answer
    A. Public void setMajorTickSpacing(int spacing)
    Explanation
    The given correct answer is "public void setMajorTickSpacing(int spacing)". This method is used to set the spacing between major ticks on the slider. In this case, the major tick spacing is set to 10, so the slider will have ticks at positions 0, 10, and 20.

    Rate this question:

  • 16. 

    TCP (Transmission Control Protocol) includes:- 3 choices

    • Port 20 FTP, Port 21 FTP

    • Port 161 SNMP

    • Port 23 Telnet

    • Port 162 SNMP

    • Port 25 SMTP

    Correct Answer(s)
    A. Port 20 FTP, Port 21 FTP
    A. Port 23 Telnet
    A. Port 25 SMTP
    Explanation
    TCP (Transmission Control Protocol) is a widely used protocol in computer networking. It ensures reliable and ordered delivery of data packets between devices over a network. The given answer includes the correct ports associated with specific protocols. Port 20 and Port 21 are used for FTP (File Transfer Protocol), which is commonly used for transferring files between a client and a server. Port 23 is used for Telnet, a protocol that allows remote access to a device's command-line interface. Port 25 is used for SMTP (Simple Mail Transfer Protocol), which is responsible for sending email messages between servers.

    Rate this question:

  • 17. 

    This depicts the graphical part on the screen.It takes the data and various states from the Other part to render the component's graphical part.

    • Controller

    • View

    • Model

    Correct Answer
    A. View
    Explanation
    The given correct answer is "View". In the context of software development, the View is responsible for the graphical part on the screen. It takes data and various states from the Model and Controller to render the component's graphical part. The View is responsible for displaying the user interface and presenting information to the user.

    Rate this question:

  • 18. 

    This is a Java program which is meant to run as a part of a web page.

    • JFrame

    • JApplet

    • JDialog

    • JPanel

    • JWindow

    Correct Answer
    A. JApplet
    Explanation
    This Java program is designed to run as a part of a web page. JApplet is a class in Java that allows you to create applets, which are small applications that can be embedded within a web page. Therefore, using JApplet would be the correct choice for running this program as a part of a web page.

    Rate this question:

  • 19. 

    This class is used to display a group of items.It allows you to choose one or more items., Items can be displayed in one or more columns.

    • JComboBox

    • JList

    • JTextare

    Correct Answer
    A. JList
    Explanation
    JList is the correct answer because it is a class in Java Swing that is used to display a group of items. It allows the user to choose one or more items from the list. The items in the list can be displayed in one or more columns. JComboBox is used to create a drop-down list of items, while JTextArea is used to create a multi-line text input area.

    Rate this question:

  • 20. 

    Which Statements are true?

    • A Swing Timer can fire only one ActionEvent

    • A Timer can be configured to fire events repeatedlly

    Correct Answer
    A. A Timer can be configured to fire events repeatedlly
    Explanation
    A Timer can be configured to fire events repeatedly because it is designed to schedule and execute tasks at specified intervals. By setting the initial delay and interval, the Timer can repeatedly fire ActionEvents at the specified time intervals. This allows for repetitive actions or tasks to be performed automatically without the need for manual intervention.

    Rate this question:

  • 21. 

    This layout manager allows you to stack components one behind another.

    • BorderLayout

    • FlowLayout

    • CardLayout

    • GridLayout

    Correct Answer
    A. CardLayout
    Explanation
    CardLayout is a layout manager that allows you to stack components one behind another. It is useful when you want to switch between different components, such as displaying different panels or cards in a container. Each component is added to the layout with a unique name, and you can easily switch between them using methods like next() or show(). This layout manager is commonly used in GUI applications where you need to display different views or screens based on user interactions.

    Rate this question:

  • 22. 

    This Method is used to add a horizontally long component as the column header.

    • JScrollPane

    • DCJ

    Correct Answer
    A. JScrollPane
    Explanation
    JScrollPane is a Java Swing component that provides a scrollable view of a component. It is commonly used to add scrolling functionality to components that are too large to fit within a container. In this case, the method mentioned is used to add a horizontally long component as the column header. This means that the JScrollPane is being used to display a component horizontally, such as a table or a list, as the header of a column.

    Rate this question:

  • 23. 

    Any hex character (0-9, a-f or A-F).

    • 1

    • 2

    • None of above

    Correct Answer
    A. None of above
    Explanation
    The given question asks for a hex character, which can be any character from the range 0-9, a-f, or A-F. However, the correct answer states "None of above," indicating that none of the options provided (1 and 2) are hex characters.

    Rate this question:

  • 24. 

    Which statements are true?- 2 choices

    • The port numbers ranging from 0 to 1023 are reserved

    • The physical connection is logically numbered within a range of 0 to 65500

    • The destination address identifiers the computer

    Correct Answer(s)
    A. The port numbers ranging from 0 to 1023 are reserved
    A. The destination address identifiers the computer
    Explanation
    The first statement is true because port numbers ranging from 0 to 1023 are indeed reserved for well-known services and protocols. The second statement is false because the physical connection is not logically numbered within a range of 0 to 65500. The third statement is true because the destination address in networking identifies the computer or device that the data is being sent to.

    Rate this question:

  • 25. 

    Any character (Character.isLetter). All lowercase letters are mapped to upper case.  in MaskFormatter class.

    • #

    • A

    • `

    • U

    • H

    Correct Answer
    A. U
    Explanation
    The given correct answer is "U" because in the MaskFormatter class, all lowercase letters are mapped to uppercase. This means that if any lowercase letter is entered as a character, it will be automatically converted to its uppercase equivalent.

    Rate this question:

  • 26. 

    Lightweight components includes:- 3 choices

    • JPanel, FormattedTextField

    • JFrame,

    • JCheckBox, JRadioButton

    • JButton,JPasswordTextField

    • JLabel

    Correct Answer(s)
    A. JCheckBox, JRadioButton
    A. JButton,JPasswordTextField
    A. JLabel
    Explanation
    The correct answer includes JCheckBox, JRadioButton, JButton, JPasswordTextField, and JLabel. These components are considered lightweight because they are implemented entirely in Java and do not rely on the underlying operating system. They are more efficient in terms of memory usage and performance compared to heavyweight components, which are dependent on the operating system for rendering.

    Rate this question:

  • 27. 

    Any character (Character.isLetter). All upper case letters are mapped to lower case.

    • L

    • None

    Correct Answer
    A. L
    Explanation
    The given explanation suggests that the letter "L" remains unchanged because it is already in its lowercase form.

    Rate this question:

  • 28. 

    JList can be supported scrolling inherently by JScrollPane as JComboBox

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The given statement is false. While JScrollPane can support scrolling for JList, JComboBox cannot inherently support scrolling. JScrollPane is specifically designed to provide a scrollable view for components like JList, JTable, and JTextArea. However, JComboBox is a drop-down list that displays a single item at a time and does not have built-in scrolling functionality.

    Rate this question:

  • 29. 

    Marshalling

    • Converting Data into on-the-wire-format

    • Converting on-the-wire-format into Data

    • Invocation of remote method

    • Transmitting and receiving data

    Correct Answer
    A. Converting Data into on-the-wire-format
    Explanation
    Marshalling refers to the process of converting data into a format that can be transmitted over a network or stored in a file. This involves transforming the data into a standardized on-the-wire format, which ensures compatibility and interoperability between different systems. By converting the data into on-the-wire format, it becomes easier to transmit and receive the data across different platforms and network protocols.

    Rate this question:

  • 30. 

    Which statements are true?- 3 choices

    • TCP is a connection-based protocol that provides a reliable flow of data between two computer.

    • You do not write programs at the lower level like application, instead you generally program at the transport level.

    • Java provides the java.net package which contains all the necessary classes to perform system-independent network communications.

    • TCP guarantees that data sent from one end of the connection is received at the other end.

    • The first layer in the TCP protocol is the network layer.

    Correct Answer(s)
    A. TCP is a connection-based protocol that provides a reliable flow of data between two computer.
    A. Java provides the java.net package which contains all the necessary classes to perform system-independent network communications.
    A. TCP guarantees that data sent from one end of the connection is received at the other end.
    Explanation
    The given answer is correct because it accurately states that TCP is a connection-based protocol that ensures reliable data flow between two computers. It also correctly mentions that Java provides the java.net package, which includes the necessary classes for system-independent network communications. Additionally, it correctly states that TCP guarantees the successful reception of data sent from one end of the connection to the other.

    Rate this question:

  • 31. 

    This layer is responsible for setting up connections using sockets.It listens for incoming calls, and manages requests from remote reference layer

    • Stub and Skeleton Layer

    • Transport Protocol Layer

    • Remote Reference Layer

    Correct Answer
    A. Transport Protocol Layer
    Explanation
    The Transport Protocol Layer is responsible for setting up connections using sockets and managing requests from the remote reference layer. It listens for incoming calls and ensures the reliable delivery of data between the communicating systems. This layer handles the segmentation and reassembly of data, as well as error detection and correction. It provides end-to-end communication services and ensures the proper flow control and congestion control mechanisms are in place.

    Rate this question:

  • 32. 

    Which statements are true?- 3 choices

    • The java.rmi.Remote interface server to distinguish interfaces which are non remote.

    • A RMI application has to expose methods, which remote clients can invoke.

    • The java.rmi.Remote is a maker interface.

    • The skeleton resides on the client side.

    • The stub resides on the server side.

    Correct Answer(s)
    A. The java.rmi.Remote interface server to distinguish interfaces which are non remote.
    A. A RMI application has to expose methods, which remote clients can invoke.
    A. The java.rmi.Remote is a maker interface.
    Explanation
    The given answer is correct because it accurately identifies the statements that are true. The java.rmi.Remote interface is used to distinguish interfaces that are non-remote. A RMI application must expose methods that remote clients can invoke. The java.rmi.Remote interface is a marker interface.

    Rate this question:

  • 33. 

    Event handling of JTextArea is:

    • None - Event Handling.

    • AddFocusListener(new FocusListener(){ public void focusGained(FocusEvent fe){ } public void focusLost(FocusEvent ev){ } });

    • AddActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ev){ } });

    Correct Answer
    A. AddActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ev){ } });
    Explanation
    The correct answer is "addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ev){ } });". This is because JTextArea does not have a built-in action event, so in order to handle events when the user interacts with the JTextArea, an ActionListener needs to be added. The actionPerformed method within the ActionListener is where the code for handling the event should be written.

    Rate this question:

  • 34. 

    This is as part of its view provides four corners where you can add components.

    • JLabel

    • JFrame

    • JScrollPane

    • JPanel

    Correct Answer
    A. JScrollPane
    Explanation
    The JScrollPane is the correct answer because it is a component in Java Swing that provides a scrollable view of a component. In this case, the question mentions that "it" (referring to something not specified) provides four corners where you can add components. The JScrollPane has four corners where you can add components, allowing you to customize the scrollable view as needed.

    Rate this question:

  • 35. 

    Which a three layered architecture is based on?

    • Stub and Skeleton Layer

    • Stub Reference Layer

    • Remote Reference Layer

    • Transport Reference Layer

    • Transport Protocol Layer

    Correct Answer(s)
    A. Stub and Skeleton Layer
    A. Remote Reference Layer
    A. Transport Protocol Layer
    Explanation
    The correct answer is the Stub and Skeleton Layer, Remote Reference Layer, and Transport Protocol Layer. The three-layered architecture is based on these layers which are responsible for different functionalities. The Stub and Skeleton Layer handles the communication between the client and server by generating stubs and skeletons. The Remote Reference Layer manages the remote object references and handles the object communication. The Transport Protocol Layer ensures the reliable delivery of messages between the client and server using various protocols.

    Rate this question:

  • 36. 

    This class is both a container and a components.

    • JWindow

    • JApple

    • JFrame

    • JDialog

    • JPanel

    Correct Answer
    A. JPanel
    Explanation
    The correct answer is JPanel because it is a class in Java that can act as both a container and a component. It can be used to group other components together and also be added to other containers. This makes it a versatile class for creating user interfaces in Java applications.

    Rate this question:

  • 37. 

    Valid values of orientation in Method of JSlider are:-2 choices.

    • SwingConstants.HORIZONTAL

    • Swing.Constant.HORIZONTAL

    • Swing.Constants.VERTICAL

    • Public void setOrientation(int orientation);

    • SwingConstants.VERTICAL

    Correct Answer(s)
    A. SwingConstants.HORIZONTAL
    A. SwingConstants.VERTICAL
    Explanation
    The valid values for the orientation parameter in the Method of JSlider are SwingConstants.HORIZONTAL and SwingConstants.VERTICAL. The SwingConstants class provides constants for specifying the orientation of components in Swing. In this case, the setOrientation method is used to set the orientation of the JSlider. The answer includes the correct values, SwingConstants.HORIZONTAL and SwingConstants.VERTICAL.

    Rate this question:

  • 38. 

    Which statements are true?- 3 choice

    • A JDialog is a top-level container.

    • The container is physically constrained with the max size offered by the screen on which it display

    • To return the parent, it is required to close the modal dialog

    • If you click on the parent of the modal dialog box, it appears

    Correct Answer(s)
    A. A JDialog is a top-level container.
    A. The container is physically constrained with the max size offered by the screen on which it display
    A. To return the parent, it is required to close the modal dialog
    Explanation
    A JDialog is a top-level container means that it can be displayed independently of any other window or frame. The container being physically constrained with the max size offered by the screen on which it displays means that it cannot exceed the maximum size of the screen. To return the parent, it is required to close the modal dialog means that in order to access the parent window or frame, the modal dialog needs to be closed first.

    Rate this question:

  • 39. 

    This is a Java object associated with a container which governs the placement and size of the component.

    • GridLayout

    • BorderLayout

    • Layout Manager

    • CardLayout

    • FlowLayout

    Correct Answer
    A. Layout Manager
    Explanation
    A layout manager is a Java object that is associated with a container and controls the placement and size of the components within that container. It determines how the components are arranged and displayed on the user interface. Different layout managers have different rules for positioning and resizing components. In this context, the correct answer is "Layout Manager" as it accurately describes the Java object responsible for managing the layout of components within a container.

    Rate this question:

  • 40. 

    Any character (Character.isLetter).

    • ?

    • A

    • U

    • *

    Correct Answer
    A. ?
    Explanation
    The correct answer is "?" because the given statement "Any character (Character.isLetter)" implies that the answer can be any character that is a letter. Since "?" is a letter, it satisfies the condition and is therefore the correct answer.

    Rate this question:

  • 41. 

    Transport Layer

    • Converting Data into on-the-wire-format

    • Transmitting and receiving data

    • Invocation of remote method

    • Set connection

    • Converting on-the-wire-format into Data

    Correct Answer
    A. Set connection
    Explanation
    The correct answer is "Set connection." In the context of the Transport Layer, setting a connection refers to the establishment of a logical connection between two endpoints. This connection allows for the reliable transmission of data between the sender and receiver. Once the connection is established, data can be transmitted and received efficiently and securely. The other options mentioned in the question, such as converting data into on-the-wire format and converting on-the-wire format into data, are also important functions of the Transport Layer but are not specifically related to setting a connection.

    Rate this question:

  • 42. 

    The setRowHeaderView() method is used to add horizontally long component.

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The setRowHeaderView() method is actually used to add a component that will be displayed in the row header of a JScrollPane. It is not specifically used for adding horizontally long components. Therefore, the given statement is false.

    Rate this question:

  • 43. 

    Container components are:3 choices

    • Jlabel

    • JPanel

    • JFrame

    • JApplet

    • JTextField

    Correct Answer(s)
    A. JPanel
    A. JFrame
    A. JApplet
    Explanation
    Container components are components that can contain other components. They provide a way to organize and manage the layout of other components within them. In this case, the correct answer includes JPanel, JFrame, and JApplet. JPanel is a lightweight container that is commonly used to group and organize other components. JFrame is a top-level container that represents a window in a GUI application. JApplet is a container specifically designed for creating applets, which are small applications that run within a web browser. JTextField, on the other hand, is not a container component but rather a text input component.

    Rate this question:

  • 44. 

    Which statements are true?

    • Once the pattern is applied to the MessageFormat instances, you invoke the getString();

    • The MessageFormat class can be used to create a compound message.

    • The applyPatern() method is used to fetch an element from the Resource Bundle

    • A template is a string, which contained only the fixed part of the message.

    • The date and numeric values contained in a message need not to be translated.

    Correct Answer
    A. The MessageFormat class can be used to create a compound message.
    Explanation
    The MessageFormat class can be used to create a compound message. This means that it allows for the creation of messages that contain dynamic elements, such as variables or placeholders, that can be replaced with actual values at runtime. This is useful for situations where the message needs to be customized or personalized based on specific data or conditions.

    Rate this question:

  • 45. 

    Event Handling of JComboBox is :- 2 choices

    • AddListSelectionListener

    • ListSelectionListener Vs valueChanged()

    • ActionListener() Vs actionPerformed()

    • AddActionListener

    Correct Answer(s)
    A. ActionListener() Vs actionPerformed()
    A. AddActionListener
    Explanation
    The correct answer is ActionListener() Vs actionPerformed(),addActionListener.

    This is because the JComboBox component in Java Swing allows users to select an item from a drop-down list. To handle events related to the JComboBox, we need to use an ActionListener interface and its corresponding actionPerformed() method. This method is called when the user selects an item from the JComboBox. To register the ActionListener with the JComboBox, we use the addActionListener() method. Therefore, the correct answer is ActionListener() Vs actionPerformed(),addActionListener.

    Rate this question:

  • 46. 

    The language code consisting of two or more letters in Lower case and the country code consisting of two letter in uper case.

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The statement is false because the language code consists of two or more letters in lower case, but the country code consists of two letters in upper case.

    Rate this question:

  • 47. 

    Common Methods of JScroPanel class are:-3 choices.

    • Public void setCorner(String key, component corner)

    • Public void setHorizontalScrollBarPolicy(int policy)

    • Public void setVerticalScrollBarPolicy(int policy)

    • Public void setHorizontalScrollBarPolicy(String key, policy)

    • Public void actionPerformed(ActionEvent e)

    Correct Answer(s)
    A. Public void setCorner(String key, component corner)
    A. Public void setHorizontalScrollBarPolicy(int policy)
    A. Public void setVerticalScrollBarPolicy(int policy)
    Explanation
    The correct answer is public void setCorner(String key, component corner), public void setHorizontalScrollBarPolicy(int policy), public void setVerticalScrollBarPolicy(int policy). These methods are commonly used in the JScroPanel class. The setCorner method is used to set the corner component for a specific key in the scroll pane. The setHorizontalScrollBarPolicy method is used to set the horizontal scroll bar policy, determining when the horizontal scroll bar should be displayed. The setVerticalScrollBarPolicy method is used to set the vertical scroll bar policy, determining when the vertical scroll bar should be displayed.

    Rate this question:

  • 48. 

    Which statements are true?- 3 choices

    • MVC Architecture was first introduced in SmallTalk.

    • Model represents the view of the components

    • Controller reacts to the user inputs from Keyboard and Mouse

    • View represents the Data.

    • Separable Architecture combines the View and Controller.

    Correct Answer(s)
    A. MVC Architecture was first introduced in SmallTalk.
    A. Controller reacts to the user inputs from Keyboard and Mouse
    A. Separable Architecture combines the View and Controller.
    Explanation
    The first statement is true because MVC Architecture was indeed first introduced in SmallTalk. The second statement is true because the model represents the data and not the view of the components. The third statement is true because the controller is responsible for reacting to user inputs from the keyboard and mouse. The fourth statement is false because the view represents the components and not the data. The fifth statement is true because separable architecture combines the view and controller.

    Rate this question:

  • 49. 

    MVC Architecture decomposes components:

    • MVC: Model View Controller

    • None

    Correct Answer
    A. MVC: Model View Controller
    Explanation
    The correct answer is MVC: Model View Controller. MVC architecture decomposes components by separating the application into three interconnected components: the model, which represents the data and business logic, the view, which represents the user interface, and the controller, which handles user input and updates the model and view accordingly. This separation of concerns allows for easier maintenance, reusability, and scalability of the application.

    Rate this question:

Quiz Review Timeline (Updated): Mar 21, 2023 +

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 16, 2008
    Quiz Created by
    Vietha
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.