MCQs > IT & Programming > Java > Output of the given console application? public class Test28 { public static void main(String[] args) { Doc.test(); } } class Doc { public String summary() { return ''doc#''; } public static void test() { Doc[] docs = new Doc[] {new Doc(), new Spec()}; for (Doc d: docs) System.out.print(d.summary()); } } class Spec extends Doc { public String summary() { return ''spc#''; } }

Java MCQs

What is the output of the given console application? public class Test28 { public static void main(String[] args) { Doc.test(); } } class Doc { public String summary() { return ""doc#""; } public static void test() { Doc[] docs = new Doc[] {new Doc(), new Spec()}; for (Doc d: docs) System.out.print(d.summary()); } } class Spec extends Doc { public String summary() { return ""spc#""; } }

Answer

Correct Answer: doc#doc#

Explanation:

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

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it