MCQs > IT & Programming > Core Java > What will be the output of this code? class Main { static abstract class Base { protected Base() { init(); } abstract void init(); } static class Child extends Base { private final int value; public Child() { value = 5; } @Override public void init() { System.out.println("value = " + value); } } public static void main(String[] args) { Child c = new Child(); } }

Core Java MCQs

What will be the output of this code? class Main { static abstract class Base { protected Base() { init(); } abstract void init(); } static class Child extends Base { private final int value; public Child() { value = 5; } @Override public void init() { System.out.println("value = " + value); } } public static void main(String[] args) { Child c = new Child(); } }

Answer

Correct Answer: value = 0

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Core Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Core Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it