BASIC / CATATAN</>↗Basic15 Okt 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 / CATATAN</>↗Basic15 Okt 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 { // […]
BASIC / CATATAN</>↗Basic15 Okt 2010
Every class in Java has a constructor. constructor is a method that is used to create an instance or object of the class. Every time you create an instance, you must invoke a constructor. If you do not create a constructor method of your class, the compiler will build a default one. A default constructors […]
BASIC / CATATAN</>↗Basic15 Okt 2010
Method overloading allows a method to use the same name or identifier as the method name as long as the argument list is different. Java can differentiate each method by their method signatures. For example to print some value you can create a print method that accept different kind of objects or values as its […]
BASIC / CATATAN</>↗Basic14 Okt 2010
When a class extends from other class, the class or usually called as subclass inherits all the accessible members and methods of the superclass. If the subclass overrides a method provided by its superclass, a way to access the method defined in the superclass is through the super keyword. package org.kodejava.basic; public class Bike { […]
BASIC / CATATAN</>↗Basic13 Okt 2010
Interface only contains methods declaration and all its methods are abstract methods. In its most common form, an interface is a group of related methods with empty bodies. To create an interface, use interface keyword in class definition. The file name of interface always the same with the interface name in class definition and the […]