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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1171


Is it necessary that each try block must be followed by a catch block?

1074


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

1374


Explain the hierarchy of java exception classes?

1185


What is arraylist e?

1147


What is backdrop?

1133


How to use string tokenizer class.

1279


Can we convert list to set in java?

1052


What does the string method compareto () do?

1116


What is the difference between double and float variables in java?

1201


What is an empty list in java?

1030


What does substring mean?

1031


How does regex work?

1022


Can we create our own wrapper class in java?

1017


What is a method declaration?

1034