Deck 9: Java Multithreading and Exception Handling

ملء الشاشة (f)
exit full mode
سؤال
What is multithreaded programming?

A)It's a process in which two different processes run simultaneously.
B)Its a process in which two or more parts of same process run simultaneously.
C)Its a process in which many different process are able to access same information.
D)Its a process in which a single process can access information from many sources.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Which of these are types of multitasking?

A)Process based multitasking
B)Thread based multitasking
C)Both a & b
D)None of the mentioned
سؤال
Which of these packages contain all the Java's built in exceptions?

A)java.io
B)java.util
C)java.lang
D)java.net
سؤال
Thread priority in Java is?

A)Integer
B)Float
C)Double
D)Long
سؤال
What will happen if two thread of same priority are called to be processed simultaneously?

A)Any one will be executed first lexographically
B)Both of them will be executed simultaneously
C)None of them will be executed
D)It is dependent on the operating system.
سؤال
Which of these statements is incorrect?

A)By multithreading CPU's idle time is minimized, and we can take maximum use of it.
B)By multitasking CPU's idle time is minimized, and we can take maximum use of it.
C)Two thread in Java can have same priority
D)A thread can exist only in two states, running and blocked.
سؤال
Which method executes only once

A)start() method
B)init() method
C)stop() method
D)destroy() method
سؤال
Thread class is available in

A)java.io package
B)java.lang package
C)java.awt package
D)java.util package
سؤال
Minimum threads in a program are

A)1
B)2
C)5
D)Many
سؤال
Interfaces helps in which type of inheritance

A)Multiple inheritance
B)Multilevel inheritance
C)Hierarchical inheritance
D)None of above
سؤال
Which of these values is returned by read () method is end of file (EOF) is encountered?

A)0
B)1
C)-1
D)Null
سؤال
Which of these exception is thrown by close () and read () methods?

A)IOException
B)FileException
C)FileNotFoundException
D)FileInputOutputException
سؤال
Which exception is thrown by the read ( ) method of input stream class?

A)Exception
B)ClassNotFoundException
C)read Exception
D)IOException
سؤال
What garbage collection in the context of java?

A)The operating system periodically deletes all of the java files available on the system.
B)Any package imported in a program and not used in automatically deleted.
C)When all references to an object are gone, the memory used by the object is automatically reclaim
سؤال
In order for a source code file, containing the public class test, to successfully compile, which of the following must be true?

A)It must have a package statement
B)It must be named test.java
C)It must import java.lang
D)It must declare a public class named test.
سؤال
Which of the following are true about the Error and Exception classes?

A)Both classes extend throwable
B)The error class is final and exception class is not.
C)The Exception class is final and the Error is not.
D)Both classes implement Throwable
سؤال
Which of the following are true?

A)The void class extends the class class
B)The float class extends double class
C)The system class extends the runtime class
D)The integer class extends the number class
سؤال
How do you create a Reader object from an InputStream object?

A)Use the static createReader() method of InputStream class
B)Use the static createReader() method of Reader class
C)Create an InputStreamReader object passing the InputStream object and an argument to the InputStreamReader constructor.
D)Create an OutputStreamReader object, passing the InputStream object as an argument to the OutputStreamReader constructor.
سؤال
Which of the following is true?

A)The event inheritance model has replaced the event delegation model
B)The event inheritance model is more efficient than event delegation model
C)The event delegation model uses event listeners to define the methods of event handling classes.
D)The event delegation model uses the handleEvent() method to support event handling.
سؤال
Which of the following is the highest class in the event delegation model?

A)java.util.EventListner
B)java.util.EventObject
C)java.util.AWTEvent
D)java.util.event.AWTEvent
سؤال
When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?

A)The first object that was added as listner.
B)The last object that was added as listner
C)There is no way to determine which listener will be invoked first.
D)It is impossible to have more than one listener for a given event.
سؤال
Suppose that you want to have an object eh handle the TextEvent of TextArea object t. How should you add eh as the event handler for?

A)t.addTextListener(eh);
B)eh.addTextListner(t);
C)addTextListner(eh.t);
D)addTextListner(t,eh);
سؤال
Which is true about an anonymous inner class?

A)It can extend exactly one class and implement exactly one interface.
B)It can extend exactly one class and can implement multiple interfaces.
C)It can extend exactly one class or implement exactly one interface.
D)It can implement multiple interfaces regardless of whether it also extends a class.
سؤال
Which is true about a method-local inner class?

A)It must be marked final.
B)It can be marked abstract.
C)It can be marked public.
D)It can be marked static.
سؤال
Which statement is true about a static nested class?

A)You must have a reference to an instance of the enclosing class in order to instantiate it.
B)It does not have access to nonstatic members of the enclosing class.
C)It's variables and methods must be static.
D)It must extend the enclosing class.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Java Multithreading and Exception Handling
1
What is multithreaded programming?

A)It's a process in which two different processes run simultaneously.
B)Its a process in which two or more parts of same process run simultaneously.
C)Its a process in which many different process are able to access same information.
D)Its a process in which a single process can access information from many sources.
Its a process in which two or more parts of same process run simultaneously.
2
Which of these are types of multitasking?

A)Process based multitasking
B)Thread based multitasking
C)Both a & b
D)None of the mentioned
None of the mentioned
3
Which of these packages contain all the Java's built in exceptions?

A)java.io
B)java.util
C)java.lang
D)java.net
java.lang
4
Thread priority in Java is?

A)Integer
B)Float
C)Double
D)Long
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
What will happen if two thread of same priority are called to be processed simultaneously?

A)Any one will be executed first lexographically
B)Both of them will be executed simultaneously
C)None of them will be executed
D)It is dependent on the operating system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of these statements is incorrect?

A)By multithreading CPU's idle time is minimized, and we can take maximum use of it.
B)By multitasking CPU's idle time is minimized, and we can take maximum use of it.
C)Two thread in Java can have same priority
D)A thread can exist only in two states, running and blocked.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which method executes only once

A)start() method
B)init() method
C)stop() method
D)destroy() method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
Thread class is available in

A)java.io package
B)java.lang package
C)java.awt package
D)java.util package
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
Minimum threads in a program are

A)1
B)2
C)5
D)Many
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
Interfaces helps in which type of inheritance

A)Multiple inheritance
B)Multilevel inheritance
C)Hierarchical inheritance
D)None of above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of these values is returned by read () method is end of file (EOF) is encountered?

A)0
B)1
C)-1
D)Null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which of these exception is thrown by close () and read () methods?

A)IOException
B)FileException
C)FileNotFoundException
D)FileInputOutputException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which exception is thrown by the read ( ) method of input stream class?

A)Exception
B)ClassNotFoundException
C)read Exception
D)IOException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
What garbage collection in the context of java?

A)The operating system periodically deletes all of the java files available on the system.
B)Any package imported in a program and not used in automatically deleted.
C)When all references to an object are gone, the memory used by the object is automatically reclaim
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
In order for a source code file, containing the public class test, to successfully compile, which of the following must be true?

A)It must have a package statement
B)It must be named test.java
C)It must import java.lang
D)It must declare a public class named test.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following are true about the Error and Exception classes?

A)Both classes extend throwable
B)The error class is final and exception class is not.
C)The Exception class is final and the Error is not.
D)Both classes implement Throwable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following are true?

A)The void class extends the class class
B)The float class extends double class
C)The system class extends the runtime class
D)The integer class extends the number class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
How do you create a Reader object from an InputStream object?

A)Use the static createReader() method of InputStream class
B)Use the static createReader() method of Reader class
C)Create an InputStreamReader object passing the InputStream object and an argument to the InputStreamReader constructor.
D)Create an OutputStreamReader object, passing the InputStream object as an argument to the OutputStreamReader constructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following is true?

A)The event inheritance model has replaced the event delegation model
B)The event inheritance model is more efficient than event delegation model
C)The event delegation model uses event listeners to define the methods of event handling classes.
D)The event delegation model uses the handleEvent() method to support event handling.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is the highest class in the event delegation model?

A)java.util.EventListner
B)java.util.EventObject
C)java.util.AWTEvent
D)java.util.event.AWTEvent
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?

A)The first object that was added as listner.
B)The last object that was added as listner
C)There is no way to determine which listener will be invoked first.
D)It is impossible to have more than one listener for a given event.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
Suppose that you want to have an object eh handle the TextEvent of TextArea object t. How should you add eh as the event handler for?

A)t.addTextListener(eh);
B)eh.addTextListner(t);
C)addTextListner(eh.t);
D)addTextListner(t,eh);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which is true about an anonymous inner class?

A)It can extend exactly one class and implement exactly one interface.
B)It can extend exactly one class and can implement multiple interfaces.
C)It can extend exactly one class or implement exactly one interface.
D)It can implement multiple interfaces regardless of whether it also extends a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which is true about a method-local inner class?

A)It must be marked final.
B)It can be marked abstract.
C)It can be marked public.
D)It can be marked static.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which statement is true about a static nested class?

A)You must have a reference to an instance of the enclosing class in order to instantiate it.
B)It does not have access to nonstatic members of the enclosing class.
C)It's variables and methods must be static.
D)It must extend the enclosing class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.