Friday, September 4, 2009

SCJP Questions

Given:
1 class BaseClass {
2 Private float x = 1.0f ;
3 protected float getVar ( ) ( return x;)
4 }
5 class Subclass extends BaseClass (
6 private float x = 2.0f;
7 //insert code here
8 )
Which two are valid examples of method overriding? (Choose Two)
A. Float getVar ( ) { return x;}
B. Public float getVar ( ) { return x;}
C. Float double getVar ( ) { return x;}
D. Public float getVar ( ) { return x;}
E. Public float getVar (float f ) { return f;}
Answer: B, D

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */