Home Tutorial Java Scjp Part1 SCJP Module-1 Question-26


Share on Google+Share on Google+
SCJP Module-1 Question-26
Posted on: July 21, 2010 at 12:00 AM
The Sample program given below will test your understanding about the abstract class and Inheritance in Java.

Given a sample code:

abstract class A {
abstract void a1();

void a2() {
System.out.print(" A");

class B extends A {
void a1() {

void a2() {
System.out.print(" B");

class Test extends B {
public static void main(String[] args) {
A y = new B();
Test z = new Test();

What will be the result? Choose the correct option?

(A) A A
(B) A B
(C) B B
(D) B A




Related Tags for SCJP Module-1 Question-26:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 21, 2010

Recommend the tutorial

Advertisements Advertisements