Professional Documents
Culture Documents
Department of Computer Applications: Marathwada Institute of Technology, Aurangabad
Department of Computer Applications: Marathwada Institute of Technology, Aurangabad
Department of Computer Applications: Marathwada Institute of Technology, Aurangabad
Mandal’s
Class: FY B.VOC
Sub: Oops With Java (MCQ)
Sub Teacher: Dr. Madhuri Joshi
1
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
1) Which of these access specifiers can be used for an interface?
A. Public
B. Protected
C. private
D. Any of the above
void f2();
void f3();
}
2
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
4) What is output of the below java code?
interface X
{
int i = 5;
}
class Y implements X
{
void f()
{
i = 10;
System.out.println("i="+i);
}
}
public class Main {
A. 0
B. 5
C. 10
D. Compiler error
3
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
5) Which is correct option about java interface?
A. Interface is used to achieve multiple inheritance in java
B. Object of an interface cannot be created.
C. An interface can extend another interface.
D. All of the above
A. Interface
B. Class
C. Compiler error
5
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
11) What is output of below java program?
interface X
{
void f();
}
interface Y extends X
{
void g();
}
class C implements Y
{
public void f() {
System.out.println("Hello");
}
public void g() {
System.out.println("World");
}
}
C o = new C();
o.f();
o.g();
}
}
A. Hello, World
B. Hello
C. World
6
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
D. Compiler error
9
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
}
A. Father’s Car
B. Son’s Car
C. There is an ambiguity, so no one Car
D. Compiler Error
20) In below java program, the class Circle implements the interface
Shape. Which polymorphism concept has been applied here?
interface Shape {
void area();
}
10
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
}
11
FY B.Voc MCQ’s On OOPS with Java Dr. Madhuri Abhijeet Joshi
}
A. Method overloading
B. Method overriding
C. No polymorphism
12
FY B.Voc MCQ’s On OOPS with JAVA Dr. Madhuri Abhijeet Joshi