Object Oriented Software Engineering View all facts Glossary Help |
subject > programming language construct > data item > variable > Java variable |
Java variable | ||||
subject | fact |
Java variable | can be accessed by other variables and methods in any class in the same package by default | |
can have an interface as its type which means that, with the variable, you can invoke any operation supported by the interface | ||
is a subtopic of The Basics of Java | ||
is declared by giving the data type followed by the name of the variable | ||
is a kind of variable | ||
should be as private as possible | ||
variable | can contain different classes of objects depending on the type of the variable | |
can refer to a particular object, several different objects during the execution of a program, or no object at all | ||
has scope | ||
has type |
Kinds of Java variable :