class Caller{
public void init() {
//private void init() {
System.out.println("Initialized");
}
public void start(){
//private void start(){
init();
System.out.println("Started");
}
}
class TestCall{
public static void main(String[] args){
Caller c = new Caller();
c.start();
c.init();
}
}
Answer is A and D(bcz init and start are private methods). If both public answer will be B(Initialized Started Initialized)
Compilation fails at line n1 and line n2. Since, both the methods are private and are not available outside the class.
So, A and D are the correct answers.
Compilation fails at line n1 because start() has private access in Caller class. "Caller" class IS NOT an inner class because it can be seen from the code block in which the class is declared and IS NOT at the member level of the class TestCall (that is, at the same level as the instance variables, constructors, or methods).
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Hirushi
Highly Voted 2 years, 5 months agohrvoojex
Most Recent 4 months, 1 week agovic88
5 months, 1 week agoMPignaProTech
6 months, 3 weeks agojoeMP
7 months agoarjunrawatirissoftware
1 year, 6 months agogg7495
1 year, 7 months agonamaoo
1 year, 8 months agojebril
1 year, 10 months agofelipegomeztreufo
1 year, 11 months agomrstevebang
2 years agoVicky_65
2 years, 1 month agotawa_z58
2 years, 2 months agoAnkit1010
2 years, 3 months agoa_really_reliable_programmer
1 year, 8 months agoDef8
2 years, 6 months agocarloswork
2 years, 6 months agoRoxyFoxy
2 years, 7 months ago