31, ఆగస్టు 2022, బుధవారం

SAMPLE,SIMPLE CODE FOR THE JAVA INTERFACES, MULTIPLE INHERITENCE, POLYMORPHISIM, UPCASTING, CLASSES,OBJECTS,ABSTRACT CLASSES



 in this some corrections u to do i purposefully kept, one for ex interface 'int' not allowed why it is the reserved word in java primitive data type, my student asked i wrote this on a rough paper

best example for the interface is OS you can explain your own how it is, we can implement poly morphism by using interfaces.

all the variables defined in the interface by default will become public, final i.e constants , these are used by implementing class

all the methods defined in the interface will become public, abstract methods

HAND SCRIPT
interface implementer class not implements all the methods of the interface it will become an ABSTRACT class. because still in the class also something is not known(abstract).see the below line 
abstract class Ramu implements  MyInterface
{
//at least one non implemented method it should be from the interface or in this class also
}





కామెంట్‌లు లేవు:

కామెంట్‌ను పోస్ట్ చేయండి