Answers for "can a variable be declared in abstract"

0

can a variable be declared in abstract

abstract class Parent {
   static void display() {
      System.out.println("Static method in an abstract class");
   }
   static int x = 100;
}
public class Example extends Parent {
   public static void main(String[] args) {
      Parent obj = new Example();
      obj.display();
      System.out.print(Parent.x);
   }
}
Posted by: Guest on November-27-2020

Code answers related to "can a variable be declared in abstract"

Browse Popular Code Answers by Language