Practice More Questions From: Quiz 06 – Polymorphism – Overloading
Q:
Suppose you have the code below. Is ‘int printSomething(int i, int j) { … }’ a valid overloaded method? public void printSomething(int i) { System.out.print(i); }
Q:
Suppose you have the code below. Is ‘void printSomething(String i) { … }’ a valid overloaded method? public void printSomething(int i) { System.out.print(i); }
Q:
You can have two overloaded methods with a difference only in the return type.
Q:
A method signature consists of:
Q:
Suppose you have the code below. Is ‘String printSomething(String i) { … }’ a valid overloaded method? public void printSomething(int i) { System.out.print(i); }
Q:
Suppose you have the code below. Is ‘void printSomething(char i, int j) { … }’ a valid overloaded method? public void printSomething(int i, char j) { System.out.print(i + “, ” + j); }
Subscribe
0 Comments