Describe overriding methods, JAVA Programming

Assignment Help:

Describe Overriding Methods ?

Assume that one day you've just finished your Car class. It's been plugged into your traffic simulation that is chugging along merrily simulating traffic. Then your pointy haired boss rolls in the door, and tells you that he requires the Car class to not accelerate past the 70 miles per hour (pointy haired bosses rarely understand the metric system) even if the car's a Ferrari along with a maximum speed in excess of 200 miles per hour.

What are you going to do? Your first reaction may be to change the class in which you already wrote so that it limits the speed of all the cars. Therefore you're using which class elsewhere and things will break if you modify it.

You could forms a fully new class in a different file, either by starting from scratch or through copying and pasting. This would work, but it would mean that if you found a bug in the Car class now you'd have to fix it in two files. And if you needed to add new methods to the Car class, you'd have to add them in two files. Still this is the best you could do if you were writing in C or a few another traditional language.


Related Discussions:- Describe overriding methods

I want to develop a chat application for j2me, I want to develop a Chat app...

I want to develop a Chat application for j2me Project Description: We require a chat application for a community website. Skills required: Java, J2ME

Describe unbalanced arrays, Describe Unbalanced Arrays ? Such as C Java...

Describe Unbalanced Arrays ? Such as C Java does not have true multidimensional arrays. Java fakes multidimensional arrays by using arrays of arrays. This means that it is prob

How can you performance tune your database?, 1. De normalizes your tables w...

1. De normalizes your tables where required. 2. Proper use of index columns: An index based on numeric parts is more efficient than an index based on character columns. 3. Re

How virtual communities are formed, How virtual communities are formed? How...

How virtual communities are formed? How these are different from other Communities? Give examples. Virtual Communities are interest-based communities. Members along with genera

What are the parts of website design, What are the parts of website design?...

What are the parts of website design? Parts of web design: There are in 3 types of elements for web design and below are there names: 1. Navigation scheme 2. Overall look and

Android app for username and password, Hi, I have an android sdk assignment...

Hi, I have an android sdk assignment which is due monday night. The user will enter the following information. url address www.google.com user name [email protected] password 12

Describe j2ee?, J2EE (Java 2 Enterprise Edition) is an environment for depl...

J2EE (Java 2 Enterprise Edition) is an environment for deploying and developing enterprise applications on various operating system. The J2EE platform consists of J2EE components,

Explain the phase compile- java program development, Explain the phase Comp...

Explain the phase Compile- Java Program Development In Phase 2, programmer gives the command javac to compile the program. Java compiler translates the java program into byte

What are the principle concepts of oops, What are the principle concepts of...

What are the principle concepts of OOPS? Principle concepts upon that object oriented programming and design rest. They are: Abstraction: Abstraction refers to the act of

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd