Difference between interface and abstract class with ex.

Answer Posted / aditya

Abstract Class :
1. Can have implemented(non-abstract) method
2. Can have any visibility public,protected,private


Interface :
1. All methods are non-implemented(abstract)
2. Only visibility is public or none
3. All variables should be static and final

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you change an int to a string?

543


What is an escape character in java?

525


Java is pass by value or pass by reference? Explain

530


Is age discrete or continuous?

684


What are extraneous variables examples?

521






Write a program to check for a prime number in java?

555


What is the purpose of garbage collection in java? When is it used?

535


Does isempty check for null?

555


What is a two-pass assembler?

602


What are the restriction imposed on a static method or a static block of code?

591


What is equals method in java?

522


What is general methodology?

565


Can you pass by reference in java?

526


Write a program to find maximum and minimum number in array?

548


How to do a true java ping from windows?

611