Describe what an Interface is and how it?s different from a
Class.
Answer Posted / amit upadhyay
interface is collection of abstract method.we can not
define any method in interface.we can implement that
abstract method by using the class.there is a restriction
in interface that you have to implement all the abstract
method in the class which is declared in interface.and we
can not create an object of interface.if we want to execute
the interface method then we have to implement first that
interface in any class after that create the object of
class ,then we can access execute that method
but in class we have to define the methods, which is
declered.we can also access that method through the object
of the class.
| Is This Answer Correct ? | 9 Yes | 5 No |
Post New Answer View All Answers
What is advantage of inheritance?
What is the difference between abstraction and polymorphism?
What is the purpose of enum?
Is data hiding and abstraction same?
Can we have inheritance without polymorphism?
What is encapsulation with real life example?
What is abstract class in oops?
What are functions in oop?
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 difference between oop and pop?
What is abstraction with example?
any one please tell me the purpose of operator overloading
Please send ford technologies placement paper 2 my mail id
What are the 4 pillars of oop?
What is class and example?