What is the output of this program?
import java.util.*; public class genericstack{ Stack stk = new Stack (); public void push(E obj) { stk.push(obj); } public E pop() { E obj = stk.pop(); return obj; } } class Output { public static void main(String args[]) { genericstack gs = new genericstack (); gs.push(36); System.out.println(gs.pop()); } }
What is the output of this program?
import java.util.*; class Output { public static void addNumbers(List super Integer> list) { for (int i = 1; i <= 10; i++) { list.add(i); } } public static void main(String args[]) { Listld = Arrays.asList(); addnumbers(10.4); System.out.println("getList(2)"); } }
What is the output of this program?
import java.util.*; class Output { public static double sumOfList(List extends Number> list) { double s = 0.0; for (Number n : list) s += n.doubleValue(); return s; } public static void main(String args[]) { Listld = Arrays.asList(1.2, 2.3, 3.5); System.out.println(sumOfList(ld)); } }
What is the output of this program?
import java.util.*; class Output { public static double sumOfList(List extends Number> list) { double s = 0.0; for (Number n : list) s += n.doubleValue(); return s; } public static void main(String args[]) { Listli = Arrays.asList(1, 2, 3); System.out.println(sumOfList(li)); } }
Which of the following keywords are used for lower bounding a wild card?