Answers for "java final modifier on method"

0

java final modifier on method

public class Shape {
  private int numberOfVertices;
  
  //with final modifier,
  //this method cannot be overridden by subclasses
  public final int getNumberOfVertices() {
    return numberOfVertices;
  }
}
Posted by: Guest on March-14-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language