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


public class Base {
public void myMethod(int a,intb) {}
}

// Uses myMethod and then hides it.
public class DerivedOne extends Base {

private void myMethod(int a,int b);
}

will this compile or not .yes or no. why

Answers were Sorted based on User's Feedback



public class Base { public void myMethod(int a,intb) {} } // Uses myMethod and then hides i..

Answer / ashwin khandelwal

It cannot be compiled because of weaker access privilege give to method in DerivedOne class while overidding method of Base Class

Is This Answer Correct ?    12 Yes 0 No

public class Base { public void myMethod(int a,intb) {} } // Uses myMethod and then hides i..

Answer / narayana

This will not compile because in the base class myMethod()
function is not having the body ,only abstract methods
should not have the body remaining all methods should have
the body

Is This Answer Correct ?    6 Yes 6 No

Post New Answer

More Core Java Interview Questions

can u handle an error if u write Thowable in the catch class lise try { some errorneous code }catch(Throwable e){ ...}

4 Answers  


Which of the classes will have more memory allocated?

0 Answers  


Is it possible to instantiate the abstract class?

0 Answers  


What is the difference between Array and Hash Table?

0 Answers   Impetus,


Explain parallel processing in java8?

0 Answers  


What is illegal identifier in java?

0 Answers  


Is null in java?

0 Answers  


can we declare private class in java file?

13 Answers  


what is difference betweem home interface and remote interface?

0 Answers   CTS, HCL,


Explain 5 io best practices?

0 Answers  


How to find the largest value from the given array.

0 Answers  


What is parameters example?

0 Answers  


Categories