Polymorphism carbonfootprint interface program, JAVA Programming

(CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chapter, you can specify similar behaviors for possibly disparate classes. Governments and companies worldwide are becoming increasingly concerned with carbon footprints (annual releases of carbon dioxide into the atmosphere) from buildings burning various types of fuels for heat, vehicles burning fuels for power, and the like. Many scientists blame these greenhouse gases for the phenomenon called global warming. Create three small classes unrelated by inheritance-classes Building, Car and Bicycle. Write an interface ICarbonFootprint with aGetCarbonFootprint method. Have each of your classes implement that interface, so that its GetCarbonFootprint method calculates an appropriate carbon footprint for that class (check out a few websites that explain how to calculate carbon footprints). Write an application that creates objects of each of the three classes, places references to those objects inList, then iterates through the List, polymorphically invoking each object's GetCarbonFootprint method.

Posted Date: 3/29/2013 2:19:27 AM | Location : United States







Related Discussions:- Polymorphism carbonfootprint interface program, Assignment Help, Ask Question on Polymorphism carbonfootprint interface program, Get Answer, Expert's Help, Polymorphism carbonfootprint interface program Discussions

Write discussion on Polymorphism carbonfootprint interface program
Your posts are moderated
Related Questions
Here are some features of spring:- ? Lightweight: spring is lightweight when it comes to size and transparency. The essential version of spring framework is around 1MB. And t


What are Access Specifiers available in Java? Java has four access specifiers, which are enlisted below: Public: public methods, classes and fields can be accessed by ever

1. "Classes are statically loaded with Java's "new" operator." This would imply that static methods could be executed without the class being loaded. 2. "Unlike the static loa


Write a Java REST client to perform the following- The client will read the contents of the file - invoice.txt. The first line of the file will display the type of the currency.

For your project, you will be designing a payroll system for a company. The company will use the system to generate payroll reports based on different kinds of employees in the com

What is meant by semantic error? Occur although a statement executes and has an effect not intended by the programmer and Frequently times occur just in unusual & infrequent ci

For this assignment you'll create some classes for modeling tickets for a city subway system. The type of system we are modeling has these main features: Stations are grouped in

Describe final arguments? At last, you can declare in which method arguments are final. This means that the techniques will not directly change them. Because all arguments are