Javatpoint Logo

could i use the both method public service() and protected service() in same program at same time.

By: vipink*** On: Fri Mar 10 16:12:36 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
and also explain how can i call the protected service() by public service() Up0Down

 
I think you can't, Although we have method overloading(two or more method with the same name in the same class) in java, the rule for overloading is its type signature should be different. This way the compiler decides which method to call based on the signature. Here type Signature means the number of parameters, types of parameters. Image Created0Down

By: [email protected] On: Fri Mar 10 17:41:33 IST 2017 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No
 
Image Created0Down

By: [email protected] On: Fri Mar 10 17:52:40 IST 2017 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No