S

Shivam • 8.86K Points
Tutor III

Q. When you pass an array to a method, the method receives ________ . 

  • (A) A copy of the array.
  • (B) A copy of the first element.
  • (C) The reference of the array.
  • (D) The length of the array.
  • Correct Answer - Option(C)
  • Views: 125
  • 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. What is the default return type to main() __________.

Q. What is the output of the program? class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } }

Q. Operator use to allocates memory to array variable in java?

Q. What will be the output of the following Java program? (Note: inputoutput.java is stored in the disk.) import java.io.*; class filesinputoutput { public static void main(String args[]) { InputStream obj = new FileInputStream("inputoutput.java"); System.out.print(obj.available()); } }

Q. what is the result of the following piece of code: public class Person{ public void talk(){ System.out.print("I am a Person"); } } public class Student extends Person{ public void talk(){ System.out.print("I am a Student"); } } public class Test{ public static void main(String args[]){ Person p = new Student(); p.talk(); } }

Q. Determine output of the following code. interface A { } class C { } class D extends C { } class B extends D implements A { } public class Test extends Thread{ public static void main(String[] args){ B b = new B(); if (b instanceof A) System.out.println("b is an instance of A"); if (b instanceof C) System.out.println("b is an instance of C"); } }

Q. Which of the following access modifiers allows access to a class member from any class in any package?

Q. How many constructors does the class Exception have?

Q. The Comparable interface contains which method

Q. The layout manager that lays out a container's components in a rectangular grid.

Learn All JAVA MCQs


Question analytics