Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write A Java Program To Explain Annotation Concept
- //1. Override
- class Animal
- {
- void eatSomething()
- {
- System.out.println("Eating Something");
- }
- }
- class Dog extends Animal
- {
- @Override
- void eatSomething()
- {
- System.out.println("Eating Foods");
- }
- }
- //TestAnnotation
- class Ex6 // This is FileName
- {
- public static void main(String args[])
- {
- Animal a = new Dog();
- a.eatSomething();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement