Thursday, May 13, 2010

Explain visibility controls used in java? define abstract class with examples in java?

I think, when they ask 'visibility' they must be referring to access modifiers. I hope u know arrays by now???


MyThings[] o = {Ball, Bat, Bike,... };


if that is just an array, then only a number will access the elements of that array. The number is called an 'index' and it is in square brackets o[2] would fetch Bike.





An Object is a fancy array, we fetch with a name instead of number. We can control the 'visibility' of both the Object and its members with the keywords:


public, private, [none, the default], protected


but the textbook term is 'access modifier'Explain visibility controls used in java? define abstract class with examples in java?
use google

No comments:

Post a Comment