R

Ram Sharma • 193.86K Points
Coach

Q. Which Java method is used to clear element of ArrayList?

  • (A) deleteAll()
  • (B) delete()
  • (C) clearAll()
  • (D) clear()
  • Correct Answer - Option(D)
  • Views: 168
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.

Related MCQs on JAVA

Q. Which component is responsible for converting bytecode into machine specific code?

Q. How do you declare and initialize an array of integers with 5 elements in Java?

Q. Suppose A is an abstract class, B is a concrete subclass of A, and both A and B have a default constructor. Which of the following is correct? 1. A a = new A(); 2. A a = new B(); 3. B b = new A(); 4. B b = new B();

Q. Which of these operators can skip evaluating right hand operand?

Q. What will be the output of the following Java program? interface calculate { int VAR = 0; void cal(int item); } class display implements calculate { int x; public void cal(int item) { if (item<2) x = VAR; else x = item * item; } } class interfaces { public static void main(String args[]) { display[] arr=new display[3]; for(int i=0;i<3;i++) arr[i]=new display(); arr[0].cal(0); arr[1].cal(1); arr[2].cal(2); System.out.print(arr[0].x+" " + arr[1].x + " " + arr[2].x); } }

Q. Which of those doesn’t have an index based structure?

Q. Which of these is a non-access modifier?

Q. Which of the following is the correct way to declare a hexadecimal value in Java?

Q. Memory is allocated to an object once the execution of ___ is over in Java language.

Q. What will be the output of the following Java code? class A { public int i; private int j; } class B extends A { void display() { super.j = super.i + 1; System.out.println(super.i + " " + super.j); } } class inheritance { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); } }

Learn All JAVA MCQs


Question analytics