Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Examen

PRJ 311 Full Test Bank | Complete Solutions (Verified)

Note
-
Vendu
-
Pages
69
Grade
A
Publié le
14-09-2024
Écrit en
2024/2025

PRJ 311 Full Test Bank | Complete Solutions (Verified) To get an object NumberFormat class that initialized to the specified locale, we use a. getNumberFormat() b. getCurrencyInstance() c. getNumberInstance() d. getInstance() Which type of driver can interpret JDBC calls to the database-specific native call interface a. Type-1 b. Type-2 c. Type-4 d. Type-3 Which are advantages of JDBC? (select two) a. enable connecting to any database system b. vendor independent c. platform independent d. database access faster than other languages Formatting the captions of the GUI components ensures that the look and feel of the application is in a locale-sensitive manner a. TRUE b. FALSE Which statements are CORRECT about properties file? (Select 2) a. A Locale is an identifier for a particular combination of language and region b. To create a properties file, it must use Netbeans or a Java editor c. Extensions of the properties file must be ".properties" Internationalized software should be developed such that it can be adapted without engineering changes a. FALSE b. TRUE Which type of driver can use a bridging technology that provides JDBC access via ODBC drivers a. Type-4 b. Type-2 c. Type-1 d. Type-3 RMI does not allow you to serialize and transmit objects a. TRUE b. FALSE Which distributed object technology is most appropriate for systems that consist entirely of Java objects? a. CORBA b. RMI c. DOM d. DCE When using URL class, which method is used to make a connection with that URL? a. makeConnection() b. openConnection() c. connect() d. accept() When a connection is established, we can get which streams a. input stream b. output stream c. both input stream and output stream d. in-out stream A server must retrieve the InputStream and OutputStream from the proxy socket object to communicate with the client a. FALSE b. TRUE The _______ method wakes up all threads that are waiting for a monitor a. notify() b. join() c. notifyAll() d. wait() Which RMI layer make invocation to remote methods a. Remote Reference layer b. Transport layer c. Stub and Skeleton layer ______ facilitates many parts of same program to run serially but access a same resource a. Multithread b. DaemonThread c. Threading d. MonoThread 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 InputStreamReader(Input Stream())); } catch(Exception ex) { StackTrace(); } b. Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStreamReader( InputStream())); } catch(Exception ex) { StackTrace(); } Correct c. Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStreamReader(Stream())); } catch(Exception ex) { StackTrace(); } d. Socket socket; String host; BufferedReader reader; try { socket = new Socket("localhost", 200); reader = new BufferedReader(new InputStream(InputStream())); } catch(Exception ex) { StackTrace(); } To create ServerSocket object, it should know the address or port of the client to communicate a. TRUE b. FALSE A remote object is an instance of the class that implements the .Remote interface a. FALSE b. TRUE The _______ condition describes a situation where two or more threads a blocked forever, waiting for each other a. synchronization b. race c. blocking d. deadlock Remote object and remote server are the same concept a. TRUE b. FALSE _____ is used to transmit and receive data a. Transport layer b. Remote Reference layer c. Stub and Skeleton layer All the remote methods declared should be qualified to throw the exception ___________ a. .RemoteException b. .ServerRuntimeException c. .MarshalException d. .RMIException Which class stores information about an Internet resource address including host name, file name, port number. a. URL b. Connection c. InternetAddr d. URLConnection Which protocol is used in RMI connection a. rmip b. ftp c. rmic d. http The isAlive() method sends a query to inquire, whether the thread is block or not a. FALSE b. TRUE The ______ method with the argument as true will convert the user thread to a daemon thread a. isDaemon() b. setDaemon() c. convertToDaemon() d. SetDaemon() Which package providing classes and interfaces for distributed computing in Java a. b. c. d. Which statements are TRUE about accept() method - select 2? a. The accept() method, once invoked, server will wait till a client requests for a connection Incorrect b. The accept() method is a blocking method c. When a client requests, the accept() method creates an object of class ServerSocket and returns it The ServerSocket class has a method clientAccept() for listening to client request? a. TRUE b. FALSE Which method is used to to retrieve the row IP address in textual format a. getFile() b. getLocalHost() c. getHostAddress() d. getHost() The _____ method forces the current running thread to wait until the thread it is joining with is no longer alive a. interrupt() b. wait() c. join() d. sleep() TCP is a connection-based protocol that provide a reliable flow of data between two computers a. FALSE b. TRUE Java provides the package which contains all the necessary classes to perform system-dependent network communications a. TRUE b. FALSE The JFileChooser by default displays all the files in the current directory a. FALSE b. TRUE Thread priorities are numbers and range from Thread.NORM_PRIORITY to Thread.MAX_PRIORITY a. FALSE b. TRUE The ______ method causes a thread to release the lock or monitor of the object, allowing another thread to access it a. wait() b. notifyAll() c. finalize() d. notify() The ______ method returns true if the thread is a user thread a. verifyDaemon() b. setDaemon() c. isDaemon() d. getDaemon() The getPriority() and setPriority() methods retrieve and set the current priority of any thread respectively a. TRUE b. FALSE The deadlock situation allows the normal execution of the program after few minutes a. FALSE b. TRUE Using new TextField(10) will create a TextField that only accepts 10 characters of input. a. Depends on the particular implementation of the Java Virtual Machine b. FALSE c. TRUE The JList has a method addListSelectionListener() to register a selection listener a. TRUE b. FALSE Which method do you use to start a Thread? a. init() b. Depends on the particular implementation of the Java Virtual Machine c. run() d. begin() e. start() f. departure() A synchronised block is a _____ or a _____ qualified by synchronized keyword a. block of code b. method c. class d. function The lock in synchronized block is based on the method and on the object a. FALSE b. TRUE A menu system provides a bar above the window's title bar called as menu bar a. FALSE b. TRUE Which statements are CORRECT about network resource? (Select 3) a. The resource can be an HTML page, an image or simply any file 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 d. The format of the resource name depends on the protocol being used Reserved ports ranges from 0 to 1023 a. FALSE b. TRUE A JDialog is a top-level container a. TRUE b. FALSE How many items can be selected from a JComboBox object at a time? A. 0 B. 1 C. 2 D. Unlimited _______________ returns the selected item on a JComboBox jcbo. A. SelectedIndex() B. SelectedItem() C. SelectedIndices() D. SelectedItems() The method __________ adds an item s into a JComboBox jcbo. A. (s) B. Choice(s) C. Item(s) D. Object(s). Clicking a JComboBox object generates an ItemEvent event, A. if an item is selected. B. if a new item is selected. ____________ is a component that enables the user to choose a single value or multiple values. A. A text field B. A combo box C. A list D. A label ______________ sets the background of the selected item in list jlst to yellow. A. Background(Color.YELLOW) B. SelectedBackground(Color.YELLOW) C. SelectionBackground(Color.YELLOW) D. Selectionbackground(Color.YELLOW) Clicking a JList object generates __________ events. A. ActionEvent and ItemEvent B. ItemEvent and ComponentEvent C. ComponentEvent and ContainerEvent D. ActionEvent and ContainerEvent The coordinate of the upper-left corner of a frame is __________. A. (0, 0) B. (25, 25) C. (100, 100) D. (10, 10) Suppose a button jbt is placed in a frame, the coordinate of the button within the content pane of the frame is _______. A. (X(), Y()) B. (jbt.x, jbt.y) C. cannot be obtained D. (0, 0) The header for the paintComponent method is ________________. A. private void paintComponent(Graphics g) B. protected void paintComponent(Graphics g) C. public void paintComponent(Graphics g) D. protected void paintComponent() You should override the __________ method to draw things on a Swing component. A. repaint() B. update() C. paintComponent() D. init() You can draw graphics on any GUI components. A. true B. false To draw graphics, it is better to define a class that extends ________ and override the paintComponent method. A. JLabel B. JButton C. JPanel D. JComponent import .*; import .*; public class Test { public static void main(String[] args) { JFrame frame = new JFrame("My Frame"); (new MyDrawing("Welcome to Java!")); Size(300, 300); DefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Visible(true); Visible(true); } } class MyDrawing extends JPanel { String message; public MyDrawing(String message) { ge = message; } public void paintcomponent(Graphics g) { Component(g); String(message, 20 ,20); } } A. The program runs fine and displays Welcome to Java! B. The program has a compile error because the paintcomponent should be spelled as paintComponent. C. The program has a runtime error because the paintcomponent should be spelled as paintComponent. D. The program runs, but it does not display the message. E. It is a runtime error to invoke the setVisible(true) twice. import .*; import .*; public class Test extends JFrame { public Test() { add(new MyDrawing("Welcome to Java!")); } public static void main(String[] args) { JFrame frame = new JFrame(); Size(300, 300); DefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Visible(true); } } class MyDrawing extends JPanel { String message; public MyDrawing(String message) { ge = message; } public void paintComponent(Graphics g) { Component(g); String(message, 20 ,20); } } A. The program runs fine and displays Welcome to Java! B. The program would display Welcome to Java! if new JFrame() is replaced by Test(). C. The program would display Welcome to Java! if new JFrame() is replaced by new Test(). D. The program would display Welcome to Java! if new JFrame() is replaced by new Test("My Frame"). Analyze the following code. import .*; import .*; import .*; public class Test1 extends JFrame { public Test1() { add(new MyCanvas()); } public static void main (String[] args) { JFrame frame = new Test1(); Size(300, 300); DefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Visible(true); } } class MyCanvas extends JPanel { private String message; public void setMessage(String message) { ge = message; } public void paintComponent(Graphics g) { Component(g); String(message, 20, 20); } } A. The program runs fine and displays nothing since you have not set a string value. B. The program would display Welcome to Java! if you replace new MyCanvas() by new MyCanvas("Welcome to Java!"). C. The program has a compile error because new Test1() is assigned to frame. D. The program has a NullPointerException since message is null when String (message, 20, 20) is executed. Given a Graphics object g, to draw a line from the upper left corner to the bottom right corner, you use __________. A. Line(0, 0, 100, 100) B. Line(0, 0, getWidth(), getHeight()) C. Line(0, 0, getHeight(), getHeight()) D. Line(0, 0, getWidth(), getWidth()) Given a Graphics object g, to draw an outline of a rectangle of width 20 and height 50 with the upper-left corner at (20, 20), you use __________. A. Rect(20, 50, 20, 20) B. RectFill(20, 20, 20, 50) C. Rect(20, 20, 20, 50) D. RectFill(20, 50, 20, 20) Given a Graphics object g, to draw an circle with radius 20 centered at (50, 50), you use __________. A. Oval(50, 50, 20, 20) B. Oval(50, 50, 40, 40) C. Oval(30, 30, 20, 20) D. Oval(30, 30, 40, 40) Given a Graphics object g, to draw a filled oval with width 20 and height 30 centered at (50, 50), you use __________. A. Oval(50, 50, 20, 30) B. Oval(50, 50, 40, 30) C. Oval(30, 30, 20, 30) D. Oval(30, 30, 40, 30) E. Oval(40, 35, 20, 30) To repaint graphics, invoke __________ on a Swing component. A. repaint() B. update() C. paintComponent() D. init() Invoking __________ returns the width of the string in a FontMetrics object fm. A. getLength(s) B. Height(s) C. gWidth(s) D. Width(s) To create an Image object from an ImageIcon object imageIcon, use the __________ method. A. imageI() B. imageIImage() C. imageIImage() D. imageInImage() Swing components that don't rely on native GUI are referred to as ___________. A. lightweight components B. heavyweight components C. GUI components D. non-GUI components

Montrer plus Lire moins
Établissement
PRJ 311
Cours
PRJ 311

Aperçu du contenu

PRJ 311 Full Test Bank


To get an object NumberFormat class that initialized to the specified locale, we use

a. getNumberFormat()
b. getCurrencyInstance()
c. getNumberInstance()
d. getInstance()

Which type of driver can interpret JDBC calls to the database-specific native call
interface

a. Type-1
b. Type-2
c. Type-4
d. Type-3

Which are advantages of JDBC? (select two)

a. enable connecting to any database system
b. vendor independent
c. platform independent
d. database access faster than other languages

Formatting the captions of the GUI components ensures that the look and feel of the
application is in a locale-sensitive manner
a. TRUE
b. FALSE

Which statements are CORRECT about properties file? (Select 2)

a. A Locale is an identifier for a particular combination of language and region
b. To create a properties file, it must use Netbeans or a Java editor
c. Extensions of the properties file must be ".properties"

Internationalized software should be developed such that it can be adapted without
engineering changes
a. FALSE
b. TRUE

Which type of driver can use a bridging technology that provides JDBC access via
ODBC drivers

a. Type-4

,b. Type-2
c. Type-1
d. Type-3

RMI does not allow you to serialize and transmit objects
a. TRUE
b. FALSE

Which distributed object technology is most appropriate for systems that consist entirely
of Java objects?

a. CORBA
b. RMI
c. DOM
d. DCE

When using URL class, which method is used to make a connection with that URL?

a. makeConnection()
b. openConnection()
c. connect()
d. accept()

When a connection is established, we can get which streams

a. input stream
b. output stream
c. both input stream and output stream
d. in-out stream

A server must retrieve the InputStream and OutputStream from the proxy socket object
to communicate with the client
a. FALSE
b. TRUE

The _______ method wakes up all threads that are waiting for a monitor

a. notify()
b. join()
c. notifyAll()
d. wait()

Which RMI layer make invocation to remote methods

a. Remote Reference layer

,b. Transport layer
c. Stub and Skeleton layer

______ facilitates many parts of same program to run serially but access a same
resource

a. Multithread
b. DaemonThread
c. Threading
d. MonoThread

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 InputStreamReader(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();
} Correct
c. Socket socket;
String host;
BufferedReader reader;
try {
socket = new Socket("localhost", 200);
reader = new BufferedReader(new InputStreamReader(socket.getStream()));
} catch(Exception ex) {
ex.printStackTrace();
}
d. Socket socket;
String host;
BufferedReader reader;
try {
socket = new Socket("localhost", 200);

, reader = new BufferedReader(new InputStream(socket.getInputStream()));
} catch(Exception ex) {
ex.printStackTrace();
}

To create ServerSocket object, it should know the address or port of the client to
communicate
a. TRUE
b. FALSE

A remote object is an instance of the class that implements the java.rmi.Remote
interface
a. FALSE
b. TRUE

The _______ condition describes a situation where two or more threads a blocked
forever, waiting for each other

a. synchronization
b. race
c. blocking
d. deadlock

Remote object and remote server are the same concept
a. TRUE
b. FALSE

_____ is used to transmit and receive data

a. Transport layer
b. Remote Reference layer
c. Stub and Skeleton layer

All the remote methods declared should be qualified to throw the exception
___________

a. java.rmi.RemoteException
b. java.rmi.ServerRuntimeException
c. java.rmi.MarshalException
d. java.rmi.RMIException

Which class stores information about an Internet resource address including host name,
file name, port number.

a. URL
b. Connection

École, étude et sujet

Établissement
PRJ 311
Cours
PRJ 311

Infos sur le Document

Publié le
14 septembre 2024
Nombre de pages
69
Écrit en
2024/2025
Type
Examen
Contient
Questions et réponses

Sujets

€25,10
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
NurseHenny EXAMS
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
158
Membre depuis
2 année
Nombre de followers
72
Documents
1952
Dernière vente
5 jours de cela
AFFORDABLE EXAMS AND STUDY GUIDES

On this page you will find verified, well elaborated exams and packages, offered by seller NURSE HENNY.

4,3

29 revues

5
20
4
5
3
0
2
1
1
3

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions