-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am working on a simple abstract database class. In my usage of this class, I'll want to have some instance be a singleton. I was thinking of having a abstract class that is not a singleton, and then extend it into another abstract class that is a singleton. Is this possible? Recommended?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Is it OK to derive an abstract class from a non-abstract class or is there something wrong with this approach?
Here´s a little example:
public class Task {
// Some Members
}
public abstract class PeriodicalTask : Task {
// Represents a base class for task that has to be done periodicaly.
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
So I have code set up like this:
public interface IInterface {
public void setField(Object field);
}
public abstract class AbstractClass extends JPanel implements IInterface {
private Object field_;
public void setField(Object field) {
field_ = field;
}
}
public class…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I'm new to Java and I have a beginner question:
NumberFormat is an abstract class and so I assume I can't make an instance of it. But there is a public static (factory?) method getInstance() that allow me to do
NumberFormat nf = NumberFormat.getInstance();
I'm quite confuse. I'll be glad…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I'm new to Java and I have a beginner question:
NumberFormat is an abstract class and so I assume I can't make an instance of it. But there is a public static (factory?) method getInstance() that allow me to do
NumberFormat nf = NumberFormat.getInstance();
I'm quite confuse. I'll be glad…
>>> More