© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu

Home Placements Interview Questions Java Interview Questions And Answers Java Interview Questions On Classes, Objects and Access Specifiers ▼

Java Interview Questions On Classes, Objects and Access Specifiers

19. Which of the following are the java keywords?
[a] final
[b] Abstract
[c] Long
[d] static

Answer
[a] final
[d] static

20. Which of the following statements are true about defining method?
[a] Transient is a valid modifier.
[b] Methods with no access modifier can be called from main() method.
[c] Abstract methods have no implementation in the class where they are defined.
[d] static is a valid modifier for methods

Answer
[b] Methods with no access modifier can be called from main() method.
[c] Abstract methods have no implementation in the class where they defined.
[d] static is a valid modifier for methods

Note: The answer [b], if the method is declared as static then it is possible, else need an instance of the class.

21. Which of the following declarations of top level class Person are legal, assuming Employee is an existing class?
[a] private class Person extends Employee
[b] native class Person extends Employee
[c] transient Person extends Employee
[d] public class Person extends Employee

Answer
[d] public class Person extends Employee

22. Which of the following modifiers are valid for top level classes?
[a] public
[b] private
[c] protected
[d] final

Answer
[a] public.
[d] final

Next
1 2 3 4 5 6 7 8
SLogix Student Projects
bottom