Filters
Question type

Study Flashcards

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.

Correct Answer

verifed

verified

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

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

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

Correct Answer

verifed

verified

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

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

Correct Answer

verifed

verified

A

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


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

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

Correct Answer

verifed

verified

The keyword used to create a package is


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

Correct Answer

verifed

verified

B

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.*

Correct Answer

verifed

verified

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


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

Correct Answer

verifed

verified

C

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


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

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 {}

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

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.

Correct Answer

verifed

verified

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


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

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

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

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()

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

Correct Answer

verifed

verified

Showing 1 - 20 of 25

Related Exams

Show Answer