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
Are polymorphisms mutations?
What is constructor in oop?
How is class defined?
What is the point of oop?
What are the three main types of variables?
What is encapsulation with real life example?
What is abstraction and encapsulation?
What is the real life example of polymorphism?
What does I oop mean?
Can an interface inherit a class?
when to use 'mutable' keyword and when to use 'const cast' in c++
Why do we use class in oops?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is pure oop?
Why is oop better than procedural?