Java
T
point
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Android
Interview Q
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Question 1
:
Given:
class One {
public One foo() { return this; }
}
class Two extends One {
public One foo() { return this; }
}
class Three extends Two {
// insert method here
}
Which one method, inserted individually, correctly complete the Three class?
1.
public void foo() {}
2.
public int foo() { return 3; }
3.
public Two foo() { return this; }
4.
public Object foo() { return this; }