category

home / developersection / category

Abstract Classes in Java
java 19-May-2016
Abstract Classes in Java

For an interface containing several methods, a developer can provide the implementation for some of the methods in a class that implements the interface.

Creating a Copy Constructor
java 19-May-2016
Creating a Copy Constructor

One more benefit of constructor overloading is the ability to create a copy constructor, which allows us to create an object copy from the values of another similar object.

Interfaces in Java: Syntax with Example code
java 18-May-2016
Interfaces in Java: Syntax with Example code

Interface Syntax:An interface uses syntax similar to that of a class declaration. The format of the interface syntax is shown here:Modifiers interface

Interfaces in Java
java 18-May-2016
Interfaces in Java

When we are learning Inheritance, we go through a point that Java does not support multiple inheritance—in other words, a class cannot have two or more super classes. Multiple inheritance has its own advantages and disadvantages.

The static Keyword: Multiple Static Blocks
java 18-May-2016
The static Keyword: Multiple Static Blocks

A static block is executed only once when the class is loaded. Our class may contain multiple static blocks. These are executed in the order in which

The static Keyword: The Static Initializers
java 17-May-2016
The static Keyword: The Static Initializers

We use constructors to initialize non-static fields of a class. The constructors are called at the time of object creation and complete the initializations defined in them before the object becomes ready to use.

Java Access Modifiers: The protected and default Modifiers
java 17-May-2016
Java Access Modifiers: The protected and default Modifiers

The protected ModifierGoing back to our asset management example, we have defined several classes that lie in a single hierarchy. The Asset, BankAccou

Java Access Modifiers: The public and the private Modifiers
java 17-May-2016
Java Access Modifiers: The public and the private Modifiers

The public ModifierPreviously we understand the visibility of members at certain level using access modifiers in java. Now here we see public modifier

Visibility Modes and Access Modifiers in Java
java 17-May-2016
Visibility Modes and Access Modifiers in Java

We know java uses four access modifiers public, protected, default and private to maintain visibility at various levels. Let’s discuss how to define t

The final keyword: final variable of class type
java 17-May-2016
The final keyword: final variable of class type

Earlier we created and used variables of the class type that hold references to the objects of those class types. Now, we’ll cover an important situation in which such a variable of the class type is declared final.

The final keyword: final methods
java 17-May-2016
The final keyword: final methods

Just the way we create final classes, we create final methods that cannot be overridden in the subclasses. To explain the purpose behind this, let’s look at an example.

Package Statements in java
java 16-May-2016
Package Statements in java

The package statement allows us to group logically related classes into a single unit. In our earlier programs, we have used import statements such as the following: