Skip to main content

Write a java program to implement multiple inheritance | VCMIT

Multiple Inheritance.


INPUT

interface Car
{
    int speed=60;
    public void distanceTravelled();
}
interface Bus
{
    int distance=100;
    public void speed();
}
public class Vehicle implements Car,Bus
{
    int distanceTravelled;
    int averageSpeed;
    public void distanceTravelled()
    {
        distanceTravelled=speed*distance;
        System.out.println("Total Distance Travelled is : "+distanceTravelled);
    }
    public void speed()
    {
        int averageSpeed=distanceTravelled/speed;
        System.out.println("Average Speed maintained is : "+averageSpeed);
    }
    public static void main(String args[])
    {
        Vehicle v1=new Vehicle();
        v1.distanceTravelled();
        v1.speed();
    }
}

OUTPUT



Comments

Popular posts from this blog

Types Of Software | VCMIT

Types Of Softwares The two main types of software are system software and application software. System software is a type of computer program designed to run a computer's hardware and application programs. System software coordinates the activities and functions of the hardware and software. In addition, it controls the operations of the computer hardware and provides an environment or platform for all the other types of software to work in. The best-known example of system software is the operating system (OS), which manages all the other programs in a computer. Application software is a computer software package that performs a specific function for an end user or, in some instances, for another application. An application can be self-contained or a group of programs. The program is a set of operations that runs the application for the user. Applications use the computer's OS and other supporting programs, typically system software, to function. Application software is differ...

Software Engineering - Spiral Model | VCMIT

Spiral Model The spiral model, initially proposed by Boehm, is an evolutionary software process model that couples the iterative feature of prototyping with the controlled and systematic aspects of the linear sequential model. It implements the potential for rapid development of new versions of the software. Using the spiral model, the software is developed in a series of incremental releases. During the early iterations, the additional release may be a paper model or prototype. During later iterations, more and more complete versions of the engineered system are produced. Each cycle in the spiral is divided into four parts: Objective setting: Each cycle in the spiral starts with the identification of purpose for that cycle, the various alternatives that are possible for achieving the targets, and the constraints that exists. Risk Assessment and reduction: The next phase in the cycle is to calculate these various alternatives based on the goals and constraints. The focus of evaluation ...

A Brief History Of Software | VCMIT

History Of Software The Early Days of Software Computer scientist Tom Kilburn is responsible for writing the world’s very first piece of software, which was run at 11 a.m. on June 21, 1948, at the University of Manchester in England. Kilburn and his colleague Freddie Williams had built one of the earliest computers, the Manchester Small-Scale Experimental Machine (also known as the “Baby”). The SSEM was programmed to perform mathematical calculations using machine code instructions. This first piece of software took “only” 52 minutes to correctly compute the greatest divisor of 2 to the power of 18 (262,144). For decades after this groundbreaking event, computers were programmed with punch cards in which holes denoted specific machine code instructions. Fortran, one of the very first higher-level programming languages, was originally published in 1957. The next year, statistician John Tukey coined the word “software” in an article about computer programming. Other pioneering programmin...