What are the fundamental concepts of OOP?

Write the coding for the following OOP base concepts?

  • 2. Car and lorry are type of vehicles. But lorry has additional property capacity which is maximum transferrable weight of lorry. This weight can be accessed by the method transferrableWeight ( ). Implement these two special classes of vehicles by extending the vehicle class.

  • Answer:

    I am sorry I dont know VB you might know VB i guess . I can give you the structure in Java. so you can refer it and model from it class vehicle { // all of the public methods will be available in classes car and lorry private int CC ; private int BHP; public int getCC() { return this.CC ; } public void setCC(int cc) { this.CC = cc; } public int getBHP() { return this.BHP ; } public void setBHP(int bhp) { this.BHP = bhp; } } class car extends vehicle { // some variables and functions } class lorry extends vehicle { private int MaxTransWeight ; public int transferrableWeight ( ) { return MaxTransWeight ; } public void setTransferrableWeight (int weight ) { MaxTransWeight = weight ; } }

Nadini at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.