[HD Pg 242, Sec. 9.2.3 - valid-combinations-of-access-modifiers-abstract-final-and-static]
Moderator: admin
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
[HD Pg 242, Sec. 9.2.3 - valid-combinations-of-access-modifiers-abstract-final-and-static]
Why is allowed for an abstract class to have concrete private instance methods?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: [HD Pg 242, Sec. 9.2.3 - valid-combinations-of-access-modifiers-abstract-final-and-static]
Here are some questions that you should consider:
What do you think is the relation between the two things? Why do you think it should not be allowed?
What is the purpose of an abstract class? What is the purpose of a private instance method?
What do you think is the relation between the two things? Why do you think it should not be allowed?
What is the purpose of an abstract class? What is the purpose of a private instance method?
If you like our products and services, please help us by posting your review here.
-
- Posts: 202
- Joined: Mon Apr 02, 2018 8:40 am
- Contact:
Re: [HD Pg 242, Sec. 9.2.3 - valid-combinations-of-access-modifiers-abstract-final-and-static]
I have found a use case for the private method:
Code: Select all
public class TestClass{
abstract class Cc{
private void whap(){};
public void doSomething(){ whap(); };
}
public static void main(String args[]){
}
}
Who is online
Users browsing this forum: No registered users and 26 guests