You are not logged in.

#1 2015-06-13 04:50:46

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Code Fragments:

Java Quizzes Java Language Interfaces And Abstract Classes

Directions:
interface Base{
      boolean m1 ();
      byte m2(short s);
}

Question:
Which two code fragments will compile?
1. interface Base2 implements Base {}

2. abstract class Class2 extends Base
    { public boolean m1(){ return true; }}

3. abstract class Class2 implements Base {}

4. abstract class Class2 implements Base
    { public boolean m1(){ return (7 > 4); }}

5. abstract class Class2 implements Base
    { protected boolean m1(){ return (5 > 7) }}

Option A):
1 and 2
Option B):
2 and 3
Option C):
3 and 4
Option D):
1 and 3

Correct Answer is Option C):
3 and 4


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-13 04:50:46

Advertisement
Ads By Google

Re: Code Fragments:



\n

Board footer