Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java Static Top-level Class

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

class Main {
 public static void main(String[] args) {
   Animal.displayInfo();
 }
}
 
PREVIOUS NEXT
Tagged: #Java #Static #Class
ADD COMMENT
Topic
Name
1+9 =