Wednesday 11 February 2015

Core Java Technical Interview Questions and Answers (Page 5)

Below are some important Core Java interview questions which are asked in most MNC company interviews for beginners or professionals.

21. Does the order of public and static declaration matter in main method?
No it doesn't matter but void should always come before main().

22. Can a source file contain more than one Class declaration?
Yes a single source file can contain any number of Class declarations but only one of the class can be declared as public.

23. What is a package?
Package is a collection of related classes and interfaces. package declaration should be first statement in a java class.

24. Which package is imported by default?
java.lang package is imported by default even without a package declaration.

25. Can a class declared as private be accessed outside it's package?
Not possible.
More Questions & Answers :-
Page1  Page2  Page3  Page4  Page5  Page6  Page7  Page8

No comments:

Post a Comment