What isan abstract class and when do you use it?



What isan abstract class and when do you use it?..

Answer / hrpynux@gmail.com

An abstract class allows you to create functionality that subclasses can implement or override. An interface only allows you to define functionality, not implement it. And whereas a class can extend only one abstract class, it can take advantage of multiple interfaces.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?

5 Answers  


What is a package?

2 Answers  


What language is java written?

0 Answers  


What is the purpose of garbage collection in java?

0 Answers  


What are different types of states exist for a thread?

0 Answers  






How does serialization work

3 Answers   Ordain Solutions,


why the constructor should be used in class,if there is no constructor what will happen?

4 Answers  


When you say String is immutable, what do you mean by that? Say I have String s = "Ness" s= s+"Technologies"; What will happen? If the value gets appended, then what is the meaning of immutable here?

5 Answers   Ness Technologies,


what is difference between String buffer and String builder?

5 Answers   Benchmark,


Which browsers work with java?

0 Answers  


How can you handle java exceptions?

0 Answers  


What is the use of flag?

0 Answers  


Categories