Filters
Question type

Study Flashcards

Which of these classes is related to all the exceptions that cannot be caught?


A) Error
B) Exception
C) None of these
D) a & b

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

Which of these classes is related to all the exceptions that can be caught by using catch?


A) Error
B) Exception
C) None of these
D) a & b

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

Which of these keywords must be used to monitor for exceptions?


A) try..catch
B) finally
C) throw
D) throws

E) A) and C)
F) All of the above

Correct Answer

verifed

verified

The code within the ----------- block will always be executed whether or not an exception is thrown.


A) try..catch
B) finally
C) throw
D) throws

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

Which of these is correct way of inheriting class A by class B?


A) class B + class A {}
B) class B inherits class A {}
C) class B extends A {}
D) class B extends class A {}

E) A) and D)
F) B) and D)

Correct Answer

verifed

verified

Which of the following is incorrect statement about packages?


A) Package defines a namespace in which classes are stored.
B) A package can contain other package within it.
C) Java uses file system directories to store packages.
D) A package can be renamed without renaming the directory in which the classes are stored.

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Which of the following is correct way of importing an entire package 'pkg'?


A) import pkg.
B) Import pkg.
C) import pkg.*
D) Import pkg.*

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

Which of the following is correct way of implementing an interface salary by class manager?


A) class Manager extends salary {}
B) class Manager implements salary {}
C) class Manager imports salary {}
D) None of the mentioned

E) All of the above
F) A) and C)

Correct Answer

verifed

verified

Which of these method of class String is used to obtain length of String object?


A) get()
B) Sizeof()
C) lengthof()
D) length()

E) None of the above
F) C) and D)

Correct Answer

verifed

verified

Which of this access specifies can be used for a class so that its objects can be created by a different class in another package?


A) Public
B) Protected
C) No Modifier
D) All of the mentioned

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

A primitive data type can be passed as an argument into a method


A) By value
B) by reference
C) both a & b
D) none of these

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

The keyword used to create a package is


A) import
B) package
C) classpath
D) public

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

B

Which of the following are true about interfaces.


A) Methods declared in interfaces are implicitly private.
B) Variables declared in interfaces are implicitly public, static, and final.
C) An interface contains any number of method definitions.
D) The keyword implements indicate that an interface inherits from another.

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

Which of these method of class String is used to extract a single character from a String object?


A) CHARAT()
B) chatat()
C) charAt()
D) ChatAt()

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

Which of these is used as default for a member of a class if no access specifier is used for it?


A) private
B) public
C) public, within its own package
D) protected

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Which of these keywords is not a part of exception handling?


A) try
B) finally
C) thrown
D) catch

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

C

Which of these keywords is used to manually throw an exception?


A) try
B) finally
C) throw
D) catch

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Which of these access specifiers can be used for an interface?


A) Public
B) Protected
C) private
D) All of the mentioned

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

A

Which of these is a mechanism for naming and visibility control of a class and its content?


A) Object
B) Packages
C) Interfaces
D) None of the Mentioned

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Which of these can be used to fully abstract a class from its implementation?


A) Objects
B) Packages
C) Interfaces
D) None of the Mentione

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Showing 1 - 20 of 25

Related Exams

Show Answer