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
Can enum be null?
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.
What is overriding in oop?
is there any choice in opting subjects like 4 out of 7
What is stream in oop?
How do you achieve runtime polymorphism?
How do you use inheritance in unity?
Is this job good for future? can do this job post grduate student?
What is inheritance in simple words?
Can private class be inherited?
What is overriding in oops?
What is multilevel inheritance in oop?
Is oop better than procedural?
How to call a non virtual function in the derived class by using base class pointer
why reinterpret cast is considered dangerous?