Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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;
  }
}
Source by www.w3professors.com #
 
PREVIOUS NEXT
Tagged: #java #final #modifier #method
ADD COMMENT
Topic
Name
9+3 =