Tagged Questions
3
votes
1answer
82 views
Refactoring an existing abstract class and its parameters
I have some abstract class A so that it has some abstract method doStuff currently there are many classes that inherit A and implement doStuff.
The class' instances are initialized at run-time via ...
2
votes
6answers
623 views
What are abstract classes and abstract methods?
I got several explanations but so far I'm not able to understand that what are the abstract classes and methods in Java.
Some said it has to do something with the security of the program, other said ...
-3
votes
1answer
222 views
Abstract Class, Interface: difference and use [duplicate]
Possible Duplicate:
When to use abstract classes instead of interfaces and extension methods in C#?
What is the difference between abstract classes and interfaces in java?
And under what ...
8
votes
3answers
208 views
Should I implement an interface directly or have the superclass do it?
Is there a difference between
public class A extends AbstractB implements C
{...}
versus...
public class A extends AbstractB
{...}
AbstractB implements C
{...}
I understand that in both cases, ...
10
votes
8answers
3k views
Why should I declare a class as an abstract class?
I know the syntax, rules applied to abstract class and I want know usage of an abstract class
Abstract class can not be instantiated directly but can be extended by other class
What is the ...
12
votes
4answers
537 views
Is there a different usage rationale for abstract classes/interfaces in C++ and Java
According to Herb Sutter one should prefer abstract interfaces (all pure virtual functions) to abstract classes in C++ to decouple the implementation as far as possible. While I personally find this ...
6
votes
4answers
891 views
Can I consider interface methods as abstract methods?
I was thinking about that, and I had some doubts.
When I declare an interface, for example:
public interface MyInterface
{
public void method1();
public void method2();
}
Could these ...
7
votes
4answers
915 views
Abstract methods vs instance variables for reusable objects
I have quite a bit of Java code that I'm re-working to be re-used. The problem is that there are many pieces that are project specific so there are ends up being a higher level of coupling between ...
1
vote
2answers
754 views
What other reasons are there to write interfaces rather than abstract classes? [duplicate]
Possible Duplicate:
When to use abstract classes instead of interfaces and extension methods in C#?
When I read and looked at codes using Abstract classes, I was able to justify it because ...