BASIC / NOTES</>↗Basic15 Oct 2010
Abstract class is a class that have one or more methods declared, but not defined. Abstract class cannot have instances. This class uses in inheritance to take advantage of polymorphism. To declare that a class is abstract, use the abstract keyword in front of the class keyword in the class definition. Methods in abstract class […]
BASIC / NOTES</>↗Basic15 Oct 2010
If a subclass has a method that have the same signature with a method in its superclass, then it’s an overriding method. Override inherited methods allow subclasses to provide specialized implementation for those methods. The overriding method has the same name, number and type of arguments, and return value as the method it overrides. The […]
BASIC / NOTES</>↗Basic15 Oct 2010
Variable is a field in which object store its state. It also an allocations for the placement of data in memory. When the statement of variable declaration is compiled, some bytes of memory will be allocated for the variable. The size is determined by the type of variable. One variable definition is able to store […]
BASIC / NOTES</>↗Basic15 Oct 2010
Local variables are variables that are not fields of a class. A function or method often store its temporary state in local variables. Local variables only visible to the methods in which they are declared. Local variables must be declared and initialized before it used for the first time. Local variables will not get a […]
BASIC / NOTES</>↗Basic15 Oct 2010
Class variables or static variables are variables that are declared with static modifier. A given class will have only one copy of each of its static variables, regardless of how many times the class has been instantiated. If the value of a static variable is changed, the new value is available equally in all instances […]
BASIC / NOTES</>↗Basic15 Oct 2010
The final modifier is used to mark a class final so that it cannot be extended, to prevent a method being overridden, and to prevent changing the value of a variable. Arguments of a method if declared as final is also can not be modified within the method. package org.kodejava.basic; public class FinalExample { // […]