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 different types of access modifiers?

Answer Posted / shekhar suchak

private:it can be access within the block or we can aslo say that within the class.

public:"every where,any where" just one line ans.

protected:it can be access within package and outside of package.but there should be inheritense.

default:it will be access within the package.

class can not be private and protected.its only default and public.we dont have to mention 'default' keywords it always be there,but invisible.

Thanks & Regards

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between keyword and identifier?

1085


Which sorting algorithm is in place?

1019


How will you serialize a singleton class without violating singleton pattern?

2006


how to prepare for IT Officers Interview in Banks

2020


Can a hashset contain duplicates java?

1025


What are the different types of methodologies?

1067


What is the difference between a factory and abstract factory pattern?

1200


I want to print “hello” even before main is executed. How will you acheive that?

1149


Are arrays immutable in java?

1152


What do you mean by ordered and sorted in collections in java?

1043


What is null object in java?

1059


Why is stringbuffer thread safe?

1092


Why can't you declare a class as protected?

1208


what is the difference between the methods sleep() and wait()? : Java thread

1037


Why string is immutable with example?

1036