adplus-dvertising
frame-decoration

Question

What is the output of the following code?
class Compscibits
{
 public void m1 (int i,float f)
 {
  System.out.println(" int float method");
 }
 
 public void m1(float f,int i);
  {
  System.out.println("float int method");
  }
 
  public static void main(String[]args)
  {
    Compscibits c=new Compscibits();
        c.m1(20,20);
  }
}

a.

int float method

b.

float int method

c.

compile time error

d.

run time error

Answer: (c).compile time error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following code?

Similar Questions

Discover Related MCQs

Q. Which of these is used to access a member of class before object of that class is created?

Q. Which of these is used as a default for a member of a class if no access specifier is used for it?

Q. Which of the following statements are incorrect?

Q. Which one of the following is not an access modifier?

Q. All the variables of class should be ideally declared as?

Q. Which of the following modifier means a particular variable cannot be accessed within the package?

Q. How can a protected modifier be accessed?

Q. What happens if constructor of class A is made private?

Q. All the variables of interface should be?

Q. What is true of final class?

Q. How many copies of static and class variables are created when 10 objects are created of a class?

Q. Can a class be declared with a protected modifier.

Q. Which is the modifier when there is none mentioned explicitly?

Q. Arrays in Java are implemented as?

Q. Which of these keywords is used to prevent content of a variable from being modified?

Q. Which of these cannot be declared static?

Q. Which of these methods must be made static?

Q. String in Java is a?

Q. Which of these method of String class is used to obtain character at specified index?

Q. Which of these keywords is used to refer to member of base class from a subclass?