1. / Missing statements ? / public class NewTreeSet extends java.util.TreeSet { public static void main(String [] args) { java.util.TreeSet t = new java.util.TreeSet(); t.clear(); } public void clear() { TreeMap m = new TreeMap(); m.clear(); } } which two statements, added independently at beginning of the program, allow the code to compile? No statement is required import java.util.; import.java.util.Tree; import java.util.TreeSet; import java.util.TreeMap;





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.25 am
    (2) and (5). TreeMap is the only class that must be imported. TreeSet does not need an import statement because it is described with a fully qualified name. (1) is incorrect because TreeMap must be imported. (3) is incorrect syntax for an import statement. (4) is incorrect because it will not import TreeMap, which is required.
Show Similar Question And Answers
QA->Two statements are given followed by two conclusions I and II. You have to consider the two statements to be true even if they seem to be at variance from commonly known facts. You have to decide which one of the given conclusions is definitely drawn from the given statements. Statement : All virtuous persons are happy. No unhappy person is virtuous. Conclusions : I. Happiness is related to virtue II. Unhappy person is not virtuous.....
QA->A statement followed by two assumptions I and II is given. You have to consider the statement to be true even if it seems to be at variance from commonly known facts. You are to decide which of the given assumptions can definitely be drawn from the given statement. Indicate which one of the four given alternatives is correct ? Statement : If more encouragement is given to Sports, Indians will win more gold medals at the Olympic Games. Assumptions : I. Indians do not win gold medals. II. More enc....
QA->Average height of 10 students in a class is 150 cm. A boy of height 160 cm left the class and a boy of height 148 cm is admitted. Then what is the average height of the students in the class now?....
QA->There are 50 students in a class. In a class test 22 students get 25 marks each, 18 students get 30 marks each. Each of the remaining gets 16 marks. The average mark of the whole class is :....
QA->.....is a device by virtue of which two persons at two different places can communicate. It consists of two main parts (i) a microphone and (ii) a receiver.?....
MCQ->/ Missing statements ? / public class NewTreeSet extends java.util.TreeSet { public static void main(String [] args) { java.util.TreeSet t = new java.util.TreeSet(); t.clear(); } public void clear() { TreeMap m = new TreeMap(); m.clear(); } } which two statements, added independently at beginning of the program, allow the code to compile? No statement is required import java.util.; import.java.util.Tree; import java.util.TreeSet; import java.util.TreeMap;....
MCQ->What will be the output of the program? class Tree { } class Pine extends Tree { } class Oak extends Tree { } public class Forest1 { public static void main (String [] args) { Tree tree = new Pine(); if( tree instanceof Pine ) System.out.println ("Pine"); else if( tree instanceof Tree ) System.out.println ("Tree"); else if( tree instanceof Oak ) System.out.println ( "Oak" ); else System.out.println ("Oops "); } }....
MCQ->What will be the output of the program? import java.util.; public class NewTreeSet2 extends NewTreeSet { public static void main(String [] args) { NewTreeSet2 t = new NewTreeSet2(); t.count(); } } protected class NewTreeSet { void count() { for (int x = 0; x < 7; x++,x++ ) { System.out.print(" " + x); } } }....
MCQ->What will be the output of the program? public class CommandArgs { public static void main(String [] args) { String s1 = args[1]; String s2 = args[2]; String s3 = args[3]; String s4 = args[4]; System.out.print(" args[2] = " + s2); } } and the command-line invocation is > java CommandArgs 1 2 3 4

....
MCQ->What will be the output of the program? public class Test138 { public static void stringReplace (String text) { text = text.replace ('j' , 'c'); / Line 5 / } public static void bufferReplace (StringBuffer text) { text = text.append ("c"); / Line 9 / } public static void main (String args[]) { String textString = new String ("java"); StringBuffer textBuffer = new StringBuffer ("java"); / Line 14 / stringReplace(textString); bufferReplace(textBuffer); System.out.println (textString + textBuffer); } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution