Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what are the different access specifiers that can be used
by interfaces and abstract classes? can anyone give me
detailed description on this

Answers were Sorted based on User's Feedback



what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / vishal arora

This question leads to two things
1. modifier for abstract class or interface
2. modifier for members of abstarct class or interface

For first in abstract class and interface we can have
public , protected and default and not private if it is top
level otherwise private also if it is nested

for point 2
in an interface every member variable is public and final
in an abstract class you can assign any modifier to member
variables

Is This Answer Correct ?    10 Yes 0 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / neha jain

i feel with interface we can use public and default.and
with abstract we can use all except private

Is This Answer Correct ?    10 Yes 2 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / lydia fernandes

Interface: Public or default
Abstract Class (Anything ) : public , private or Default

Is This Answer Correct ?    5 Yes 0 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / uday

Interface: Public or default
Abstract Class (Anything ) : public , private or Default


Iam sure about these answears
-uday

Is This Answer Correct ?    7 Yes 3 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / dhiren

public accsess specifier means it can publically accessed
by the class whether it's subclass of that class or present
in same packege or diffrent classes.

private access specifier is private to that class i.e. it
cant access out side the class

procted -it's accesesed by the sub class of the ckass
whether that present in the sane package or diffrent but it
must be a subclass

noacces accessed with in the same package

Is This Answer Correct ?    5 Yes 3 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / ismail

interface can be only public or default and abstract class
should be public protected

Is This Answer Correct ?    3 Yes 1 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / bhumika

interface can use public and default.and
abstract classes can use all of them including private.

Is This Answer Correct ?    2 Yes 0 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / malay tripathi

I guess if members of interface are declared final then
they can't be overridden & hence this hampers the logic
behind having interfaces...

Interface can only be Public/Default or abstract.In any
other case it can't be overridden & hence of no use.

MemberFunctions also behave similarly.

Is This Answer Correct ?    4 Yes 3 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / karishma

Interface default access specifier are public and Static

Is This Answer Correct ?    0 Yes 0 No

what are the different access specifiers that can be used by interfaces and abstract classes? can ..

Answer / prasanna

public
private
protected
default

Is This Answer Correct ?    8 Yes 11 No

Post New Answer

More Core Java Interview Questions

What is parameter tag and what is its use?

1 Answers  


what is difference between colection and collections?

25 Answers   Amdocs, IBM, Infosys, Ipog Software, Polaris, Tech Mahindra,


Why array is used in java?

0 Answers  


In java, how many ways you can take input from the console?

0 Answers  


Why put method is idempotent?

0 Answers  


What is the integer of 16?

0 Answers  


I dont want to use serialzable in java is there any another concept so plz tell me

3 Answers   WDC,


How do you check if a string is lexicographically in java?

0 Answers  


What is the full form of jpeg?

0 Answers  


Can you declare a static variable in a method?

7 Answers  


What is the function of static in java?

0 Answers  


What is the difference between C++ & Java?

78 Answers   College School Exams Tests, HAL, SUN, Syntel, TCS, Wipro,


Categories