Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

PRJ 311 Full Test Bank | Complete Solutions (Verified)

Rating
-
Sold
-
Pages
69
Grade
A
Uploaded on
14-09-2024
Written in
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

Show more Read less
Institution
PRJ 311
Course
PRJ 311

Content preview

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

Written for

Institution
PRJ 311
Course
PRJ 311

Document information

Uploaded on
September 14, 2024
Number of pages
69
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$27.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
NurseHenny EXAMS
View profile
Follow You need to be logged in order to follow users or courses
Sold
160
Member since
2 year
Number of followers
72
Documents
1961
Last sold
4 days ago
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 reviews

5
20
4
5
3
0
2
1
1
3

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions