Sei sulla pagina 1di 19

Test D.

Java

1 . Which of the following two statements about Java Applets are true? (Choose all correct answers) A) A Java Applet is a program that must be run from within a Web browser. --[X] B) A Java Applet is a stand-alone program, it can run by itself. --C) A Java applet is not allowed to execute any applications on the local computer nor are they allowed to load any DLLs. ---[X] D) A Java Applet is allowed to read from and write to files on the local system. --2 . A container is an area where you can place your components A) TRUE ---[X] B) FALSE --3 . The _____ event is handled when the mouse is out of the component A) mouseClicked --B) mouseEntered --C) mouseExited ---[X] D) mouseReleased --E) mouseOut --F) Depends on the particular implementation of the Java Virtual Machine --4 . Select the code fragment that allows a button to generate an action event. A) button.enableActionEvents(); --B) button.addActionListener(anActionListener); ---[X] C) button.enableEvents(true); --D) button.enableEvents(AWTEvent.ACTION_EVENT_MASK); --E) Depends on the particular implementation of the Java Virtual Machine --5 . All swing components can have a MouseListener. A) TRUE ---[X] B) FALSE --C) Depends on the particular implementation of the Java Virtual Machine --6 . Which of the following illustrates the correct way to pass a parameter into an applet? A) <applet code=Test.class age=33 width=100 height=100> --B) <param name=age value=33> ---[X] C) <applet code=Test.class name=age value=33 width=100 height=100> --D) <applet code=Test.class param="name:age, value:33"> --E) Which way depends on the particular implementation of the Java Virtual Machine --7 . Which of the following classes are derived from the Container class? (Choose all correct answers) A) Component --B) Panel ---[X] C) java.applet.Applet ---[X]

D) Dialog ---[X] E) Frame ---[X] F) List --8 . Which of the following classes are derived from the Component class? (Choose all correct answers) A) Container ---[X] B) Window --C) List ---[X] D) MenuItem --E) Choice ---[X] 9 . Which of these classes can be added to any Container class, using the add method defined in Container class? (Choose all correct answers) A) Button ---[X] B) Label ---[X] C) List ---[X] D) TextArea ---[X] 10 . To have a TextArea display scrollbars, you need to place it within a ScrollPane. A) TRUE ---[X] B) FALSE --C) Depends on the particular implementation of the Java Virtual Machine --11 . Using new TextField(10) will create a TextField that only accepts 10 characters of input. A) TRUE --B) FALSE ---[X] C) Depends on the particular implementation of the Java Virtual Machine --12 . Which of the following object receives ActionEvent. Select the four correct answers. A) List ---[X] B) Button ---[X] C) Choice --D) CheckBox --E) TextField ---[X] F) MenuItem ---[X] 13 . Which of the following are valid adapter classes in Java. Select the two correct answers. A) ComponentAdapter ---[X] B) ActionAdapter --C) AdjustmentAdapter --D) ItemAdapter --E) FocusAdapter ---[X] 14 . Which of these are valid Event Listener interfaces. Select the two correct answers. A) MouseMotionListener ---[X] B) WindowListener ---[X] C) DialogListener --D) PaintListener --15 . Which code is used to create a JColorChooser A) JColorChooser ccr;

ccr = new JColorChooser(new Color.BLUE); --B) JColorChooser ccr; ccr = new JColor(Color.BLUE); --C) JColorChooser ccr; ccr = new JColorChooser(new Color(Color.BLUE)); --D) JColorChooser ccr; ccr = new JColorChooser(Color.BLUE); ---[X] 16 . A JColorChooser cannot be added as a component A) TRUE --B) FALSE ---[X] 17 . The JList has a method addListSelectionListener() to register a selection listener A) TRUE ---[X] B) FALSE --18 . How to set the single list item to be selected A) setListData() --B) setSelectedIndex() ---[X] C) setSelectedIndices() --19 . A JComboBox is a combination of a drop-down and a textfield A) TRUE ---[X] B) FALSE --20 . The method addItemListener() is used to register the ItemListener event handler A) TRUE ---[X] B) FALSE --21 . You have to instantiate the table again to reflect the data changes A) TRUE ---[X] B) FALSE --22 . Nodes which have children are called leaf-nodes A) TRUE --B) FALSE ---[X] 23 . The addTabPane() method is used to add a tab to JTabbedPane A) TRUE --B) FALSE ---[X] 24 . The two components in the splitpane can be displayed horizontally side by side, or vertically one below the other A) TRUE ---[X] B) FALSE --25 . A menu system provides a bar above the window's title bar called as menu bar A) TRUE --B) FALSE ---[X] 26 . The JFileChooser by default displays all the files in the current directory A) TRUE ---[X] B) FALSE --27 . A JDialog is a top-level container A) TRUE ---[X] B) FALSE --28 . How do you change the current layout manager for a container?

A) Use the setLayout() method ---[X] B) Once created you cannot change the current layout manager of a component --C) Use the setLayoutManager() method --D) Use the updateLayout() method --E) Use the new Layout(); statement --F) How to change the current layout manager for a container is Depends on the particular implementation of the Java Virtual Machine --29 . The _____ layout places the components in rows and columns A) Borderlayout --B) GridLayout ---[X] C) CardLayout --D) FlowLayout --E) Which layout places the components in rows and columns is Depends on the particular implementation of the Java Virtual Machine --30 . _____ uses the geographic directions of East, West, North, South and Centre to specify the location of component A) BorderLayout ---[X] B) CardLayout --C) FlowLayout --D) GridLayout --E) Which layout is Depends on the particular implementation of the Java Virtual Machine --31 . You are using the GridBagLayout manager to place a series of buttons on a Frame. You want to make the size of one of the buttons bigger than the text it contains. Which of the following will allow you to do that? A) The GridBagLayout manager does not allow you to do this --B) The setFill method of the GridBagLayout class --C) The setFill method of the GridBagConstraints class --D) The fill field of the GridBagConstraints class ---[X] E) How to do that depends on the particular implementation of the Java Virtual Machine --32 . Which of the following containers, by default, have a BorderLayout manager? (Choose all correct answers) A) Panel --B) Window ---[X] C) Dialog ---[X] D) Frame ---[X] E) Depends on the particular implementation of the Java Virtual Machine --33 . In Java, which of these classes implement the LayoutManager interface? (Choose all correct answers) A) RowLayout --B) ColumnLayout --C) GridBagLayout ---[X] D) FlowLayout ---[X] E) BorderLayout ---[X]

34 . Which of the following layout manager is the default Layout Manager for the Applet class in Java? A) FlowLayout ---[X] B) BorderLayout --C) GridLayout --D) CardLayout --E) GridBagLayout --F) Which layout manager depends on the particular implementation of the Java Virtual Machine --35 . Which of the following layout manager is the default Layout Manager for the Frame class in Java? A) FlowLayout --B) BorderLayout ---[X] C) GridLayout --D) CardLayout --E) GridBagLayout --F) Which layout manager depends on the particular implementation of the Java Virtual Machine --36 . The default alignment of buttons in Flow Layout is ... A) LEFT --B) CENTER ---[X] C) RIGHT --D) The alignment must be defined when using the FlowLayout Manager. --E) Depends on the particular implementation of the Java Virtual Machine --37 . The default horizontal and vertical gap in BorderLayout is A) 0 pixel ---[X] B) 1 pixel --C) 5 pixels --D) 10 pixels --E) The horizontal and vertical gaps must be defined when using the BorderLayout Manager. --F) Depends on the particular implementation of the Java Virtual Machine --38 . Which Layout Manager follows the following placement policy - "Lays out the components in row-major order in rows growing from left to right, and rows from top to bottom in the container." A) FlowLayout ---[X] B) BorderLayout --C) CardLayout --D) GridBagLayout --E) Which layout manager depends on the particular implementation of the Java Virtual Machine --39 . How will the following program lay out its buttons? import java.awt.*; public class MyClass { public static void main(String args[]) {

String[] labels = {"A"}; Window win = new Frame(); win.setLayout(new FlowLayout()); for(int i=0;i < labels.length;i++) win.add(new Button(labels[i])); win.pack(); win.setVisible(true); } } A) The button A will appear in the top left corner of the window. --B) The button A will appear in the center of the first row. ---[X] C) The button A will appear in the top right corner of the window. --D) The button A will appear in the middle row and column, in the center of the window. --E) compiler error --F) runtime error --40 . What is the default filling of GridBagConstraint? A) NONE ---[X] B) BOTH --C) HORIZONTAL --D) VERTICAL --E) Depends on the particular implementation of the Java Virtual Machine --41 . Which GridBagLayout variable defines the external padding (border) around the component in its display area? A) gridwidth, gridheight --B) gridx, gridy --C) fill --D) ipadx, ipady --E) insets ---[X] F) Depends on the particular implementation of the Java Virtual Machine --42 . When using the CardLayout manager, how is the card size determined? A) The component with the largest area determines the size for all --B) The widest component is combined with the shortest component to determine the size --C) The tallest component is combined with the narrowest component to determine the size --D) The widest component is combined with the tallest component to determine the size ---[X] E) Depends on the particular implementation of the Java Virtual Machine --43 . If all five areas of a BorderLayout contain a button with the same label, which of the areas will contain the widest button? A) CENTER ---[X] B) BEFORE_LINE_BEGINS --C) BEFORE_FIRST_LINE --D) WEST --E) Depends on the particular implementation of the Java Virtual Machine ---

44 . Which of the following layout managers can be used to resize some components along one axis while leaving them unchanged along the other when their container is resized on both axes? A) CardLayout --B) FlowLayout --C) GridLayout --D) GridBagLayout ---[X] E) Depends on the particular implementation of the Java Virtual Machine --45 . Can a container have multiple layout managers? A) Yes --B) No ---[X] C) Depends on the particular implementation of the Java Virtual Machine --46 . What is the default alignment for a FlowLayout? A) FlowLayout.CENTER ---[X] B) FlowLayout.LEFT --C) FlowLayout.RIGHT --D) Depends on the particular implementation of the Java Virtual Machine --47 . The default layout manager for a Frame is A) FlowLayout --B) BorderLayout ---[X] C) GridLayout --D) GridBagLayout --E) CardLayout --48 . Which is the only layout manager that always honors the size of a component. Select the one correct answer. A) FlowLayout ---[X] B) BorderLayout --C) GridLayout --D) GridBagLayout --E) CardLayout --49 . Given the following code fragment, which listener will be notified first? ActionListener al1 = new MyActionListener(); ActionListener al2 = new MyActionListener(); ActionListener al3 = new MyActionListener(); Button b = new Button("Hit Me"); b.addActionListener(al1); b.addActionListener(al2); b.addActionListener(al3); A) al1 --B) al2 --C) al3 --D) Indeterminable ---[X] E) Depends on the particular implementation of the Java Virtual Machine --50 . Internationalized software should be developed such that it can be adapted without engineering changes

A) TRUE ---[X] B) FALSE --51 . Which statements are CORRECT about I18N? (choose two) A) Internationalized software is developed separately fro each country and language --B) Successful translation of the source files in the desired language is very difficult ---[X] C) Cost of development of the product in the desired language will be much lower than the one time cost --D) Internationalization is the process of designning an application so that it can adapt to various regions ---[X] 52 . Which statements are INCORRECT about I18N? A) The translation of text is the least time-consuming part of the localization process ---[X] B) Localization is the process of adapting software for a specific region --C) Textual elements are stored outside the source code and retrieved dynamically --53 . With Localization, in order to support for new languages, it requires recompilation A) TRUE --B) FALSE ---[X] 54 . By using the String class, we can convert standard encoding systems to and from the Unicode system A) TRUE ---[X] B) FALSE --55 . Which statements are TRUE about encoding? A) Unicode provides a unique number for every character irrespective of platform, program or language ---[X] B) The Java platform does net use Unicode as its native character encoding --C) The primitive data type char in Java is based on Unicode encoding ---[X] 56 . We can crreate a properties file without the naming convention for some countries A) TRUE --B) FALSE ---[X] 57 . Which statements are CORRECT about properties file? A) Extensions of the properties file must be ".properties" ---[X] B) To create a properties file, it must use Netbeans or a Java editor --C) A Locale is an identifier for a particular combination of language and region ---[X] 58 . Which code snippet helps retrieve the locale-specific information from MessageBundle_vi_VN.properties A) Locale currentLocale; ResourceBundle messages; currentLocale = new Locale("vi", "VN"); messages = ResourceBundle.getBundle(currentLocale, "MessageBundle"); --B) Locale currentLocale; ResourceBundle messages; currentLocale = new Locale("VN", "vi");

messages = ResourceBundle.getBundle(currentLocale, "MessageBundle"); --C) Locale currentLocale; ResourceBundle messages; currentLocale = new Locale("vi", "VN"); messages = ResourceBundle.getBundle("MessageBundle", currentLocale); ---[X] D) Locale currentLocale; ResourceBundle messages; currentLocale = new Locale("VN", "vi"); messages = ResourceBundle.getBundle("MessageBundle", currentLocale); --59 . To get an object NumberFormat class that initialized to the specified locale, we use A) getCurrencyInstance() --B) getInstance() --C) getNumberFormat() --D) getNumberInstance() ---[X] 60 . Formatting the captions of the GUI components ensures that the look and feel of the application is in a locale-sensitive manner A) TRUE ---[X] B) FALSE --61 . MessageFormat class can be used to create a message with one parameter A) TRUE --B) FALSE ---[X] 62 . Which statements are INCORRECT about Localization? A) A template is a string, which contains only the fixed part of the message --[X] B) The MessageFormat class can be used to create a compound message --C) The date and numeric values contained in a message need not be translated --[X] D) the applyPattern() method is used to fetch an element from the Resource Bundle ---[X] 63 . What is the well-known port of HTTP? A) 21 --B) 25 --C) 80 ---[X] D) 137 --64 . TCP doesn't guarantees that data sent from one end of the connection is received at the other end A) TRUE --B) FALSE ---[X] 65 . TCP is a connection-based protocol that provide a reliable flow of data between two computers A) TRUE ---[X] B) FALSE --66 . Reserved ports ranges from 0 to 1023 A) TRUE ---[X] B) FALSE ---

67 . Java provides the java.net package which contains all the necessary classes to perform system-dependent network communications A) TRUE --B) FALSE ---[X] 68 . Which class stores information about an Internet resource address including host name, file name, port number. A) Connection --B) URL ---[X] C) URLConnection --D) InternetAddr --69 . Which statements are CORRECT about network resource? A) The resource can be an HTML page, an image or simply any file ---[X] B) In URL, port number to which you connect has to be specified --C) URL is a reference or an address to a resource on the Internet ---[X] D) The format of the resource name depends on the protocol being used ---[X] 70 . Which method is used to to retrieve the row IP address in textual format A) getHost() --B) getLocalHost() --C) getHostAddress() ---[X] D) getFile() --71 . When a connection is established, we can get which streams A) input stream --B) output stream --C) in-out stream --D) both input stream and output stream ---[X] 72 . When using URL class, which method is used to make a connection with that URL? A) connect() --B) accept() --C) openConnection() ---[X] D) makeConnection() --73 . Which exception can be thrown when having processing error with a stream of the connection A) Exception --B) IOException ---[X] C) URLConnectionException --D) TCPConnectionException --74 . URLConnection is an abstract class A) TRUE ---[X] B) FALSE --75 . If the openConnection() method of the URL class is not executed successfully, an IOException object is thrown A) TRUE ---[X] B) FALSE --76 . if the openConnection() method of URLConnection fails to execute, an URLConnection object is returned A) TRUE ---

B) FALSE ---[X] 77 . Which statements are FALSE about Socket? A) Socket class is used to represent the connection between a client and a server --B) If an error occurs while creating a socket, the Socket class throws an UnknownHostException ---[X] C) The Socket class represents the client or server side of the connection --D) The client need not know the host name on which the server application is running ---[X] 78 . You are trying to retrieve the InputStream of the socket. Which of the options will help you to achieved this? A) Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStream(socket.getInputStream())); } catch(Exception ex) { ex.printStackTrace(); } --B) Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", -200); reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); } catch(Exception ex) { ex.printStackTrace(); } --C) Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); } catch(Exception ex) { ex.printStackTrace(); } ---[X] D) Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStreamReader(socket.getStream())); } catch(Exception ex) { ex.printStackTrace();

} --79 . To create ServerSocket object, it should know the address or port of the client to communicate A) TRUE --B) FALSE ---[X] 80 . A server must retrieve the InputStream and OutputStream from the proxy socket object to communicate with the client A) TRUE ---[X] B) FALSE --81 . Which statements are TRUE about accept() method? A) The accept() method, once invoked, server will wait till a client requests for a connection --B) When a client requests, the accept() method creates an object of class ServerSocket and returns it ---[X] C) The accept() method is a blocking method ---[X] 82 . The ServerSocket class has a method clientAccept() for listening to client request? A) TRUE --B) FALSE ---[X] 83 . Which statements are FALSE about data package? A) A packet can be sent or received using a datagram socket --B) Multiple packets sent from one machine to another arrive in same order ---[X] C) Each packet of data sent or received on a datagram socket is individually addressed and routed --84 . The DatagramPacket does not include information about the address of the remote host? A) TRUE --B) FALSE ---[X] 85 . Which distributed object technology is most appropriate for systems that consist entirely of Java objects? A) RMI ---[X] B) CORBA --C) DOM --D) DCE --86 . Which distributed object technology is most appropriate for systems that consist of objects written in different languages and that execute on different operating system platforms? A) RMI --B) CORBA ---[X] C) DMO --D) DCE --87 . Which of the following are used by Java RMI? A) Stubs ---[X] B) Skeletons ---[X] C) ORBs --D) IIOP ---

88 . The API is part of the Java 2 Standard Editon (J2SE) A) TRUE ---[X] B) FALSE --89 . RMI allow a Java program running inside a JVM to execute a method of a class available in another same version JVM A) TRUE --B) FALSE ---[X] 90 . Which package providing classes and interfaces for distributed computing in Java A) java.net --B) javax.net --C) java.rmi ---[X] D) javax.rmi --91 . A interface that object has to implement to be transfered between application by RMI technology A) Runnable ---[X] B) Serialized --C) Serializable --D) Remote --E) Comparable --92 . RMI is low level network programming A) TRUE --B) FALSE ---[X] 93 . RMI does not allow you to serialize and transmit objects A) TRUE --B) FALSE ---[X] 94 . Which RMI layer make invocation to remote methods A) Stub and Skeleton layer --B) Remote Reference layer ---[X] C) Transport layer --95 . _______ converts data into on-the-wire format A) Serialization --B) Deserialization --C) Marshalling ---[X] D) Unmarshalling --96 . _____ is used to transmit and receive data A) Stub and Skeleton layer ---[X] B) Remote Reference layer --C) Transport layer --97 . A remote object is an instance of the class that implements the java.rmi.Remote interface A) TRUE ---[X] B) FALSE --98 . Which statements are TRUE about RMI? A) The stub must reside on both client and server sides ---[X] B) The java.rmi.Remote is a marker interface ---

C) The interface extends java.rmi.Remote specified public methods can be called by clients --99 . All the remote methods declared should be quilified to throw the exception ___________ A) java.rmi.RemoteException ---[X] B) java.rmi. from a clientException --C) java.rmi.MarshalException --D) java.rmi.ServerRuntimeException --100 . Which tool is used to register a remote object? A) rmi.exe --B) rmic.exe --C) rmiregister.exe --D) rmiregistry.exe ---[X] 101 . Remote object and remote server are the same concept A) TRUE --B) FALSE ---[X] 102 . Which protocol is used in RMI connection A) http --B) rmic ---[X] C) ftp --D) rmip --103 . The JavaMail API is a foundation package of Java A) TRUE --B) FALSE ---[X] 104 . Without JavaMail API we cannot program to read, compose and send electronic messages by Java A) TRUE --B) FALSE ---[X] 105 . Which protocol is not a mail protocol A) POP --B) FTP ---[X] C) IMAP --D) MIME --E) SMTP --F) OMAP ---[X] 106 . The javax.mail.Message is not used to create messages A) TRUE ---[X] B) FALSE --107 . We can not serializable an object over TCP socket connection A) TRUE ---[X] B) FALSE --108 . Which of the following constructors are valid declarations for the JCheckBox class? (Choose two) A) JCheckBox (Icon i) ---[X] B) JCheckBox(String s) ---[X] C) JCheckBox(label l, String s) ---

D) JCheckBox(Label l) --109 . The Swing text field is encapsulated by the JTextComponent class which extends __________________ A) Jcomponent ---[X] B) Jbutton --C) JtextField --D) JtextClass --110 . Swing is a component of ___ A) AFC (Application Foundation Class) --B) IFC (Internet Foundation Class) --C) JFC (Java Foundation Class) ---[X] 111 . The JWindow, JFame, JDialog classes differ from the AWT in that they do not use separate content pane for adding and laying out GUI components. A) TRUE --B) FALSE ---[X] 112 . Swing uses a set of class called ___ to handle events. A) event listeners ---[X] B) event handlers --113 . import javax.swing.*; class qbSwing extends JFrame { public qbSwing() { JButton b = new JButton("test"); add(b); show(); } public static void main(String args[]) { new qbSwing(); } } What is the result of the above code when compile and run? A) A frame shown with a 'test' button on it --B) compile error --C) No compile error but runtime error ---[X] 114 . To disassociate an event listener with a Swing component, which of the following must you do? A) call the remove listener method associated with the event ---[X] B) set the listener reference to null, causing the garbage collector to remove the association --C) there is no support for disassociating event listeners with components --D) call the add listener method a second time, toggling off the addition ---

115 . Swing has the Plugable Look and Feel (PL & F) feature. Look and Feel refers to the way the program interacts with the user (that is look) and the way it is presented to the user (that is feel). A) TRUE --B) FALSE ---[X] 116 . import java.net.*; import java.io.*; public class inet4 { public static void main(String arg[ ]) { InetAddress i; try { i = InetAddress.getByName(null); System.out.println("The Null host is: " + i); } catch(IOException e) { System.out.println(e); } } } What is the output of the above piece of code? A) The Null host is: null --B) The Null host is: localhost/127.0.0.1 ---[X] C) The Null host is: java.sun.com/61.10.89.31 --D) The Null host is: Name/IP address --117 . JApplet, JDialog, JFrame, and JWindow are examples of heavyweight components A) TRUE --B) FALSE ---[X] 118 . What of the following import statement that imports all the classes of the swing package do you have to take for using a swing class. A) import javax.swing.*; ---[X] B) import java.swing.*; --119 . TCP is a connection-oriented communication protocol, while UDP is a connectionless communication protocol. So UDP is less reliable than TCP. A) TRUE --B) FALSE ---[X] 120 . The ____, ______, ______, and ______ classes all use TCP to communicate over the network. (choose 4) A) URL ---[X] B) URLConnection ---[X] C) Socket ---[X]

D) ServerSocket ---[X] E) DatagramSocket --121 . Which three of the following are classes of Java.rmi package? A) Naming ---[X] B) MarshalledObject ---[X] C) RMISecurityManager ---[X] D) Remote --122 . Which of the following are classes of the Java.rmi.server package? (choose 3) A) RemoteObject ---[X] B) LogStream ---[X] C) Naming --D) RMILoader ---[X] 123 . The bind() and rebind() method belongs to which class of the java.rmi package. A) Naming class ---[X] B) RMISecurityManager class --C) RMIloader class --124 . The java.rmi.activation package contains which of the following classes? A) logstream class --B) Activable class ---[X] C) ActivationDesc class --125 . In the three-tiered layering of Java RMI, stub uses the _____________ to communicate with the skeleton A) Remote layer ---[X] B) Transport Layer --C) Implementation layer --D) Object layer --126 . The ___________ class of java.rmi package provides static methods for accessing remote objects. A) Naming Class ---[X] B) RMISecurityManager Class --C) MarshalledObject Class --127 . What are the four parts on which URL specification is based? A) Protocol ---[X] B) IP address ---[X] C) Port number ---[X] D) Actual file path ---[X] E) URL --128 . Which method of the Socket class returns the remote port to which the Socket object is connected? A) int getPort() ---[X] B) int getLocalPort() --C) InetAddress getInetAddress() --129 . Which constructor of the ServerSocket class creates a server socket on the specified port with a queue length of 50? A) ServerSocket(int port) ---[X] B) ServerSocket(int port,int maxQueue) ---

C) ServerSocket(int port, int MaxQueue,InetAddress localAddress) --130 . Which of the following are classes of Java.net package? (Choose three) A) ContentHandler ---[X] B) SocketPermission ---[X] C) FileNameMap --D) URLEncoder ---[X] 131 . _________ is a low-level routing protocol that breaks data into small packets and sends them to an address across a network, which does not guarantee to deliver packets to the destination. A) Internet Protocol ---[X] B) Transport Control Protocol --C) User Datagram Protocol --132 . We can not serializable an object over TCP socket connection A) FALSE ---[X] B) TRUE --133 . Java programs use a ___ to connect to the network. A) Socket ---[X] B) Port --134 . A _________ is one end-point of a two-way communication link between two programs running on the network. A) Socket ---[X] B) ServerSocket --C) Connection --135 . The ___ method of ServerSocket class is used to listen for a connection to be made for this socket and to wait till an coming connection is established. A) getInetAddress() --B) accept() ---[X] C) receive() --136 . Which communication protocol RMI uses? (choose 1) A) FTP --B) TCP ---[X] C) UDP --D) RMIP --E) IIOP --137 . Stub and Skeleton are always located on the same host A) TRUE --B) FALSE ---[X] 138 . ___ are used to identify the source and destination computers. A) IP Address ---[X] B) Port --139 . The DatagramSocket class uses the ___ method to receive datagrams. A) send() --B) accept() --C) receive() ---[X]

140 . How do you change the current layout manager for a container? A) Use the setLayout method ---[X] B) Once created you cannot change the current layout manager of a component --C) Use the setLayoutManager method --D) Use the updateLayout method --141 . You are using the GridBagLayout manager to place a series of buttons on a Frame. You want to make the size of one of the buttons bigger than the text it contains. Which of the following will allow you to do that? (Choose one) A) The GridBagLayout manager does not allow you to do this --B) The setFill method of the GridBagLayout class --C) The setFill method of the GridBagConstraints class --D) The fill field of the GridBagConstraints class ---[X] 142 . Which of the following containers, by default, have a BorderLayout manager? (Choose three) A) Panel --B) Window ---[X] C) Dialog ---[X] D) Frame ---[X]

Potrebbero piacerti anche