Looking for CS102 - Object-Oriented Programming 1 F1 - S25 test answers and solutions? Browse our comprehensive collection of verified answers for CS102 - Object-Oriented Programming 1 F1 - S25 at moodle.medtech.tn.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What is an abstract class?
Can an abstract superclass have non-abstract subclasses?
Can an abstract class define both abstract methods and non-abstract methods?
What is the output of the following code?
interface A
{
int var = 2;
}
class B implements A
{
void show()
{
var = 3;
System.out.println("var = "+var);
}
}
public class Main {
public static void main(String[] args) {
B obj = new B();
obj.show();
}
}
Can an abstract method be defined in a non-abstract class?
Can we declare a final interface?
Consider the following interface and class inside DelhiOffice.java file
interface IBank{
void withdraw();
void deposit();
}
abstract class Office implements IBank{
public void withdraw() {
System.out.println("Amount withdrawal");
}
}
class DelhiOffice extends Office{
public void deposit() {
System.out.println("Amount deposit");
}
public static void main(String[] args) {
IBank bank=new DelhiOffice();
bank.deposit();
}
}
What will happen after the compilation of the code?
7. The fields in an interface are implicitly specified as,
What is an abstract method?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!