category

home / developersection / category

Interfaces in Java: Implementing Multiple Interfaces
java 19-May-2016
Interfaces in Java: Implementing Multiple Interfaces

In the previous post, we created a standard interface to get the fuel efficiency of a car. A car has many such standard functions that could be defined in terms of interfaces.

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

It is possible to extend an existing interface. The purpose behind doing so is to add more declarations, both constants and methods, to an existing interface.

Interfaces in Java: Real life Example
java 18-May-2016
Interfaces in Java: Real life Example

Suppose we are asked to develop communication software such as an FTP (File Transfer Protocol) or Telnet program that uses a modem.

The static Keyword: Access Restrictions in Static Methods
java 17-May-2016
The static Keyword: Access Restrictions in Static Methods

Because a static method is invoked without a class instance, we cannot use a this or super reference in the static method.

The static Keyword:  The static methods
java 17-May-2016
The static Keyword: The static methods

Consider the example of the ball game described in here section. A player may be given the choice to select the colour of the balls. This colour choice will be applied to all the balls he creates during the game.

The static Keyword:  More about static fields
java 17-May-2016
The static Keyword: More about static fields

In the previous post, we accessed the static method getCount by using the class name

The static Keyword:  The static fields
java 17-May-2016
The static Keyword: The static fields

We have already seen the use of the static keyword in our Java programs. In fact, the first program we encountered uses the static keyword, where it was applied to the main method.

Class Concepts in Java: Parameterized and Default Constructors (Part-5)
java 17-May-2016
Class Concepts in Java: Parameterized and Default Constructors (Part-5)

After the object is constructed, we may still call its setter methods (provided we defined them in the class definition) to change the value of data members to any other value.

Structure of Java Source Files and Import Statements
java 16-May-2016
Structure of Java Source Files and Import Statements

We have learned enough from the examples given in previous posts so far to get started writing Java programs. Now, let’s discuss the complete structure of a Java source file.

The final keyword: final classes and variables
java 16-May-2016
The final keyword: final classes and variables

So far we have discussed how to inherit from an existing class. However, what if we do not want anybody to inherit from our custom class? We can restrict other developers from extending our classes with the help of the final keyword.

Inheritance in Java: Calling the super Constructor
java 16-May-2016
Inheritance in Java: Calling the super Constructor

To understand how the super keyword is used for calling the superclass constructors, let’s add the constructors to our class hierarchy here

Inheritance in Java: Writing a Multi-level Inheritance Program
java 16-May-2016
Inheritance in Java: Writing a Multi-level Inheritance Program

The application discussed in the previous post is based on the asset management classes we have studied so far. We will now look at the concepts of multilevel inheritance with the help of program code.