ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

OOP Interfaces Demo in Java - Part 3

Updated on July 13, 2009

OOP Interfaces Demo in Java - Part 3

The concept of an Interface in Java is designed to replace the functionality of multiple inheritance. C++, another object oriented programming language, supports multiple inheritance, Java does not. While Interfaces are very common in Java programming, some programmers avoid them. This example of OOP Interfaces Demo in Java provides an introduction to creating, implementing, and applying interfaces in the Java programming language. We illustrate OOP concepts with functional java source code and accompanying documentation.

package InterfaceDemo;
/**
 *
 * @author nicomp
 * This class models a NetBeans project.
 * It implements the InterfaceDemo interface.
 */
public class NetBeansProject extends BaseClass implements InterfaceDemo {

        public boolean Build() {
            boolean status = false;
//          We don't know how to build a NetBeans project, yet.
//          However, we can still implement the interface to a limited extent.

//          The code that is specific to building a NetBeans project would go here.
            System.out.println("\nHello from NetBeansProject.Build()");

            return status;
        }
}

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    Click to Rate This Article