Sun Certified Java Developer Question:
Tell me What is native keyword and abstract keyword?
Answer:
Native keyword is prefixed with method name when we want that method to be implemented using a native language like c and c++. So in the class we only declare the method and the definition of the method is in the dll file.
Abstract key word is used to mark a method or a class as logically incomplete. The class which extends this class has to provide the definition of the method or has to declare the derived class as abstract.
We can not declare a native method inside a interface because by declaring a method in an interface we want all the implementers to give definitions to the methods defined. But by declaring a method native we mean that the implementation will come from some native language.
Abstract key word is used to mark a method or a class as logically incomplete. The class which extends this class has to provide the definition of the method or has to declare the derived class as abstract.
We can not declare a native method inside a interface because by declaring a method in an interface we want all the implementers to give definitions to the methods defined. But by declaring a method native we mean that the implementation will come from some native language.