Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java @Override Annotation

class Animal {
  public void displayInfo() {
    System.out.println("I am an animal.");
  }
}

class Dog extends Animal {
  @Override
  public void displayInfo() {
    System.out.println("I am a dog.");
  }
}

class Main {
  public static void main(String[] args) {
    Dog d1 = new Dog();
    d1.displayInfo();
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: is it possible to declare two conditions in for loop in javascrip 
Java :: add string to array java 
Java :: how do you handle exceptions in java 
Java :: springboot validator manually validate 
Java :: java first index of an arraylist 
Java :: c++ vs java 
Java :: runtime exception in java 
Java :: array buffer 
Java :: java returns null 
Java :: java spring mvc 
Java :: creating a properties object using a file 
Java :: |= java operation 
Java :: how to use a while statement with char in java 
Java :: Is the main method compulsory in Java? 
Java :: Print Positives of array 
Java :: java exception handling 
Java :: how to declare a variable when using loops Java 
Java :: session management in java spring boot for login logut 
Java :: square oot of 154 
Java :: ex: java loop 
Java :: Remove ArrayList Elements using remove() function 
Java :: Calculator repeat 
Java :: arraycopy merging arrays 
Java :: lombok error unnamed 
Java :: tinyint in java 
Java :: retrofit with api key post 
Java :: Java Creating a LinkedHashMap 
Java :: The root directory of the External Storage on every android version 
Java :: hybrid inheritance in java 
Java :: spigot deal damage 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =