What's difference between public class and abstract class?
What's difference between public class and abstract class?
Re: What's difference between public class and abstract class?
Quote:
Originally Posted by
Java95
What's difference between public class and abstract class?
There is a very quick and easy way to solve that question: Google. good luck.
Re: What's difference between public class and abstract class?
I only found the difference between an Interface and an Abstract class. But thanks anyways
Re: What's difference between public class and abstract class?
Re: What's difference between public class and abstract class?
Quote:
Originally Posted by
Java95
What's difference between public class and abstract class?
Apples and oranges. Abstract classes can be public, but they don't have to be. Public classes can be abstract, but they don't have to be. So I guess that's more like comparing apples to fruit?
Re: What's difference between public class and abstract class?
Quote:
Originally Posted by
bkimminich
An abstract class is kind of a template class which cannot be instantiated w/o adding some concrete code to it.
You sure about that definition?
Code java:
public class Test{
public static void main(String... args){
AbstractTest at = new AbstractTest(){};
ExtendingClass et = new ExtendingClass();
}
}
public abstract class AbstractTest{}
public class ExtendingClass extends AbstractTest{}
Re: What's difference between public class and abstract class?
Quote:
Originally Posted by
Java95
What's difference between public class and abstract class?
As told earlier both are different concepts.
Re: What's difference between public class and abstract class?
Hi,
abstract class can contain zero or more abstract methods. It mean if a class contain abstract methods declare that class as abstract class by using abstract keyword. But whenever we apply the public on a class , it is possible to access that class inside and outside the package. That's why both are different.