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#""; } }
Correct Answer: doc#doc#
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions