When should I use abstract classes and when should I use
interfaces?

Answer Posted / ankit

if u r required more than 1 class in ur prog then use
interface because u cant extends 2 class in ur prog ...to
use 2 class in ur prog u can implement 1 interface and
extends 1 class

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use variables?

686


What do you know about java?

706


What does yield method of the thread class do?

749


How do you add an element to a set in java?

751


Difference between comparator and comparable in java?

832


What is thread start?

706


Write java program to reverse string without using api?

719


If try block is successfully executed, Then Is Finally block executed?

817


What is a boolean expression in java?

745


What is string pooling concept?

757


What is protected access modifier?

776


How do you control extraneous variables?

673


Convert Binary tree to linked list.

810


Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1664


Is null a string?

750