Java's ArrayList Class
The ArrayList package (Package: java.util) in Java lets you create and maintain a special type of collection object: an array list. An array list is similar to an array but averts many of the most common [more…]
Use Array Lists in Java
To create an array list in Java, you declare an ArrayList variable and call the ArrayList constructor to instantiate an ArrayList object and assign it to the variable: [more…]
Arrays Class in Java
The Arrays class (package: java.util) provides a collection of static methods that are useful for working with arrays. Because the Arrays class provides only static methods, it has no constructors. [more…]
Increment and Decrement Operators in Java
Increment (++) and decrement (--) operators in Java programming let you easily add 1 to, or subtract 1 from, a variable. For example, using increment operators, you can add 1 to a variable named [more…]
What Is Inheritance in Java?
Inheritance refers to a feature of Java programming that lets you create classes that are derived from other classes. A class that’s based on another class [more…]
What Is an Initializer in Java?
An initializer is a line of code (or a block of code) placed outside any method, constructor, or other block of code. Initializers are executed whenever an instance of a class is created, regardless of [more…]
Integer Data Types in Java
An integer is a whole number — that is, a number with no fractional or decimal portion. Java has four integer types, which you can use to store numbers of varying sizes. [more…]
What Is an Interface in Java ?
An interface in Java is similar to a class, but the body of an interface can include only abstract methods and final fields (constants). A class implements [more…]
Local Variables in Java
A local variable in Java is a variable that’s declared within the body of a method. Then you can use the variable only within that method. Other methods in the class aren’t even aware that the variable [more…]
Logical Operators in Java
A logical operator (sometimes called a Boolean operator) in Java programming is an operator that returns a Boolean result that’s based on the Boolean result of one or two other expressions. [more…]










