This method is called to wake up ALL threads waiting for some event. notifyall s
ID: 3858020 • Letter: T
Question
This method is called to wake up ALL threads waiting for some event.
notifyall
synchronized
wait
notify
Placing this Java reserved word on a method allows us to properly deal with problems that occur when 2 threads simultaneously access a method in an object.
synchronized
transient
volatile
protected
If an exception is derived from this class, then the compiler won't force you to check for these exceptions.
CheckedException
Throwable
RuntimeException
Exception
This code could create an output of
23
Set classes don't have Iterators, so this program
will generate an exception when the Iterator is created.
This code could create an output of
233
Because we are working with a Set class, an exception will occur on the second occurrence of:
list.add( new Data(3));
This class allows you to read objects from an I/O stream. All objects read must implement the Serializable interface.
DataInputStream
BufferedInputStream
Scanner
ObjectInputStream
Why does it NOT make sense to have an ActionAdapter class?
Because ActionListener serves only as a base interface for the other AWT listener interfaces and should not be implemented directly.
Because the ActionListener interface defines only one method.
Because ActionEvent is a low-level event.
Because ActionListener is rarely used by developers.
You would call this method inside a synchronized method when you can't progress until something else happens.
By making this call you can suspend execution until the desired operation occurs.
run
wait
sleep
notify
What is the output of the above program
21
A run time exception will occur during the run of this program
212
The compiler will generate errors on lines 20, 21, 22
Which line has an error in it (Check all that apply ... there is more than 1 line that needs to be checked)?
Line 10
Line 11
There are no errors
Line 8
Line 7
The method is called to wake up ONE thread waiting for some event.
start
notify
schedule
run
Which of the following is true about this program?
It is illegal to create a private class derived from WindowAdapter.
When you click on the "X" box in the upper right corner, the program says Goodbye.
It won't compile because the code doesn't implement the other
WindowListener methods (i.e. WindowOpened, WindowActivated, etc.)
When you click on the "X" box in the upper right corner, the program throws a "Not Implemented" exception because not all WindowListener methods have been implemented.
This I/O class allows you to write Class Objects to it that implement the Serializable interface.
PrintStream
DataOutputStream
BufferedOutputStream
ObjectOutputStream
As part of your GUI design, you want to have a dialog that contains 5 buttons arranged vertically. These buttons must take up all of the space provided by the container of the dialog. These buttons are allowed to vary in size but must be the same size as each other no matter how the dialog is resized. What strategy would be the best to use?
null (no Layout Manager). Use Set Bounds to position the buttons in the proper locations.
Create a FlowLayout instance and pass that instance to the setLayout() method of the dialog's container. Then add each of the 5 buttons in turn to that container by calling the add(Component c) method for that container.
Create a GridLayout instance using the constructor GridLayout(5,1) and pass that instance to the setLayout() method of the dialog's container. Then add each of the 5 buttons in turn to that container by calling the add(Component c) method for that container.
Create a BorderLayout instance and pass that instance to the setLayout() method of the dialog's container. Then add each of the 5 buttons in turn to that container by calling the add(Component c) method for that container.
There is a run time error on which line Number?
Line 10
Line 8
Line 9
Line 7
No Errors
This class is useful for a Client that wants to connect to a TCP/IP service.
OutputStream
ObjectOutputStream
Connection
Socket
notifyall
synchronized
wait
notify
Explanation / Answer
1) notifyall this method is called to wake up ALL threads waiting for some event.
2)Synchronized Placing this Java reserved word on a method allows us to properly deal with problems that occur when 2 threads simultaneously access a method in an object.
3)Runtime Exception this is the exception where the compiler doesnot care.
20)Scanner -This class allows you to read objects from an I/O stream. All objects read must implement the Serializable interface.
21)Why does it NOT make sense to have an ActionAdapter class? - Because the ActionListener interface defines only one method.
22 You would call this method inside a synchronized method when you can't progress until something else happens.By making this call you can suspend execution until the desired operation occurs. -wait
25)Notify -The method is called to wake up ONE thread waiting for some event.
27)object output stream -his I/O class allows you to write Class Objects to it that implement the Serializable interface.
28)Create a GridLayout instance using the constructor GridLayout(5,1) and pass that instance to the setLayout() method of the dialog's container. Then add each of the 5 buttons in turn to that container by calling the add(Component c) method for that container.
30)Socket helps in helps for the client those who want to connect on the TCP/IP
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.