Deck 8: Java Thread Class, Exception Handling, and Garbage Collection
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/16
العب
ملء الشاشة (f)
Deck 8: Java Thread Class, Exception Handling, and Garbage Collection
1
Under what circumstances might you use the yield method of the Thread class
A)To call from the currently running thread to allow another thread of the same or higher priority to run
B)To call on a waiting thread to allow it to run
C)To allow a thread of higher priority to run
D)To call from the currently running thread with a parameter designating which thread should be allowed to run
A)To call from the currently running thread to allow another thread of the same or higher priority to run
B)To call on a waiting thread to allow it to run
C)To allow a thread of higher priority to run
D)To call from the currently running thread with a parameter designating which thread should be allowed to run
To call from the currently running thread to allow another thread of the same or higher priority to run
2
Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?
A)System.free();
B)System.setGarbageCollection();
C)System.out.gc();
D)System.gc();
A)System.free();
B)System.setGarbageCollection();
C)System.out.gc();
D)System.gc();
System.gc();
3
A class that cannot be a subclass is called as______ class.
A)abstract
B)parent class
C)Final
D)none of these
A)abstract
B)parent class
C)Final
D)none of these
Final
4
When method defined in subclass which has same signature as a method in a super class, it is known as method
A)Overloading
B)Overriding
C)Packing
D)None of these
A)Overloading
B)Overriding
C)Packing
D)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following statement is correct?
A)For positive numbers, result of operators >> and >>> are same
B)Java provides two operators to do left shift <<< and <<
C)>> is the zero fill right shift operator
D)>>> is the signed right shift operator
A)For positive numbers, result of operators >> and >>> are same
B)Java provides two operators to do left shift <<< and <<
C)>> is the zero fill right shift operator
D)>>> is the signed right shift operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
6
Java language has support for which of the following types of comment ?
A)block, line and javadoc
B)javadoc, literal and string
C)javadoc, char and string
D)single, multiple and quote
A)block, line and javadoc
B)javadoc, literal and string
C)javadoc, char and string
D)single, multiple and quote
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
7
Consider the following program:
Import myLibrary.*;
Public class ShowSomeClass
{
// code for the class...
}
What is the name of the java file containing this program?
A)myLibrary.java
B)ShowSomeClass.java
C)ShowSomeClass
D)ShowSomeClass.class 1.
Import myLibrary.*;
Public class ShowSomeClass
{
// code for the class...
}
What is the name of the java file containing this program?
A)myLibrary.java
B)ShowSomeClass.java
C)ShowSomeClass
D)ShowSomeClass.class 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following is TRUE?
A)In java, an instance field declared public generates a compilation error.
B)int is the name of a class available in the package java.lang
C)Instance variable names may only contain letters and digits.
D)A class has always a constructor (possibly automatically supplied by the java compiler).
A)In java, an instance field declared public generates a compilation error.
B)int is the name of a class available in the package java.lang
C)Instance variable names may only contain letters and digits.
D)A class has always a constructor (possibly automatically supplied by the java compiler).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
9
Consider the following code snippet
String river = new String("Columbia");
System.out.println(river.length());
What is printed?
A)6
B)7
C)8
D)Columbia
String river = new String("Columbia");
System.out.println(river.length());
What is printed?
A)6
B)7
C)8
D)Columbia
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
10
What is different between a Java applet and a Java application?
A)An application can in general be trusted whereas an applet can't.
B)An applet must be executed in a browser environment.
C)An applet is not able to access the files of the computer it runs on
D)(A), (B) and (C).
A)An application can in general be trusted whereas an applet can't.
B)An applet must be executed in a browser environment.
C)An applet is not able to access the files of the computer it runs on
D)(A), (B) and (C).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
11
You read the following statement in a Java program that compiles and executes.
Submarine.dive(depth);
What can you say for sure?
A)depth must be an int
B)dive must be a method.
C)dive must be the name of an instance fie
Submarine.dive(depth);
What can you say for sure?
A)depth must be an int
B)dive must be a method.
C)dive must be the name of an instance fie
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
12
Consider
Public class MyClass
{
Public MyClass(){/*code*/
}
// more code...
}
To instantiate MyClass, you would write?
A)MyClass mc = new MyClass();
B)MyClass mc = MyClass();
C)MyClass mc = MyClass;
D)MyClass mc = new MyClass;
Public class MyClass
{
Public MyClass(){/*code*/
}
// more code...
}
To instantiate MyClass, you would write?
A)MyClass mc = new MyClass();
B)MyClass mc = MyClass();
C)MyClass mc = MyClass;
D)MyClass mc = new MyClass;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
13
In Java Inheritance
A)all fields of a class are private
B)all fields of a class are protected
C)a new class is derived from an existing class
D)none of these above
A)all fields of a class are private
B)all fields of a class are protected
C)a new class is derived from an existing class
D)none of these above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
14
When does Exceptions in Java arises in code sequence?
A)Run Time
B)Compilation Time
C)Can Occur Any Time
D)None of the mentioned
A)Run Time
B)Compilation Time
C)Can Occur Any Time
D)None of the mentioned
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of these keywords is not a part of exception handling?
A)try
B)finally
C)thrown
D)catch
A)try
B)finally
C)thrown
D)catch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of these keywords is used to manually throw an exception?
A)try
B)finally
C)throw
D)catch
A)try
B)finally
C)throw
D)catch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 16 في هذه المجموعة.
فتح الحزمة
k this deck