what is abstract class ?
when is used in real time ?
give a exp

Answer Posted / ramakrishna yechuri

An Abstract class ia class which consists at least one
abstract method(in complete method).
Advantage is the user can implement the method body as per
his require ment.

ex: connect(){} ,I implement to conncect to oracle
database,u implement to conncet to sybase,my friend
implement this method to connect to oracle db. same connect
method acting in different forms (polymorphisim).
Note: Always Interfaces is better than Abstract class,becoz
Programming to Interface is better than programming to
classes.
To avoid dependency Injection problems.(spring).

Is This Answer Correct ?    14 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can enum be null?

594


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1645


What is overriding in oop?

558


is there any choice in opting subjects like 4 out of 7

1739


What is stream in oop?

848






How do you achieve runtime polymorphism?

575


How do you use inheritance in unity?

595


Is this job good for future? can do this job post grduate student?

1699


What is inheritance in simple words?

631


Can private class be inherited?

627


What is overriding in oops?

614


What is multilevel inheritance in oop?

564


Is oop better than procedural?

584


How to call a non virtual function in the derived class by using base class pointer

5292


why reinterpret cast is considered dangerous?

1912