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...


Write 7 differences between "Public" function and
"Private" function?

Answers were Sorted based on User's Feedback



Write 7 differences between "Public" function and "Private" function?..

Answer / shankar

1. Public Functions are available to any member of the
class and Object of the class, while private functions are
available to member functions of the same class.

2. Public functions can be inherited, but private can't.

3. By making function Private we implement encapsulation,
but with public method we don't.

4 Private functions are not available in interfaces.
Interfaces only contains Public methods.

5. Private Method though it declare Static will not be
available By using Class Name.

7. Private functions can never be declared as abstract but
Public functions can be.

6. Public functions are defined using 'Public' keyword and
Private functions are defined using 'Private' keyword.

Is This Answer Correct ?    52 Yes 2 No

Write 7 differences between "Public" function and "Private" function?..

Answer / sriram

we can't access private function to the outside of the
package simply the scope of the function is with in the
function only

Is This Answer Correct ?    10 Yes 14 No

Post New Answer

More OOPS Interview Questions

What is operator overloading? Give Example

11 Answers   CTS, IBM, TCS,


why the memory allocated with new cant be freed using free()

2 Answers  


write a short note on Overloading of Binary Operator?

2 Answers  


Advantage and disadvantage of routing in telecom sector

0 Answers  


Differences between inline functions and non-inline functions?

4 Answers   Ness Technologies,


should we use linear search or binary search if elements are placed in random order or mixed?in both cases? i need a little bit detail ans?thnks

2 Answers  


what is use to destroy an object? illustrate.

5 Answers   TCS,


is java purely oop Language?

49 Answers   HCL, Infosys, TCS,


Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.

2 Answers  


Prepare me a program for the animation of train

0 Answers  


any one please tell me the purpose of operator overloading

0 Answers   Amazon,


What causes polymorphism?

0 Answers  


Categories