answersLogoWhite

0


Best Answer

You protect derived classes from breaking when you change the internal parts of the base class by making sure that the public (or protected) parts of the base class do not change. Only the private parts may change. If the public interface changes, then the derived class must often change.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you protect derived classes from breaking when you change the internal parts of the base class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which keyword can protect a class in a package from accessibility by the classes outside the package?

default


Is a T2AH fuse the same as a T2L?

No. A T2AH fuse is a high-breaking capacity type whereas a T2L is low-breaking capacity. Often, High-breaking capacity fuses have ceramic (hence stronger) tubes and low-breaking capacity fuses have glass tubes. High-breaking capacity fuses are able to protect against higher short-circuit currents than low-breaking capacity ones (which could explode under the same conditions).


What do you call the concept of renaming classes and variables to protect your Java code from being reverse engineered and easily read by someone else?

Obfuscating


What is the function of the expansion vessel?

To absorb the expansion volume of the water in the circuit after it is heated. This in turn stops the pressure rising to excessive levels which could cause system damage.An expansion vessel is a small tank that is used to protect water heating systems from excessive amounts of pressure. They can also be used to protect the cooling systems of internal combustion engines.


What is the need of package in java?

Packages are containers-for-classes used to keep the class namespace compartmentalized.Using Package,1. We can define classes inside a package that are notaccessible by the code outside that package.2. We can define class members that are only accessible by code inside that package.3. We can have a class stored in a package withoutconcern that it will collide with some other class (havin same name), stored else where.Package is basically a collection of predefined or ready-made classes that can be used in your java program to make shorter as well as easier. Package- import java.lang.*; is always implicitly called when you write a java program.

Related questions

Will tape protect an egg from breaking?

no


Why is there pools of blood surrounding the internal organs?

To protect you'r internal organs


How internal control is advantages to clients?

Internal Controls can help protect client privacy. Ex.: Good internal controls on a website will protect clients credit card numbers from hackers.


How can a base class protect derived classes so that changes to the base class will not affect them explain with example?

In order for a base class to protect derived classes, so that changes to the base class do not affect the derived classes, you must make sure that the public interface exposed by the base class does not change when the implementation of those public methods do change. You can also prevent inadvertant access to the base class attributes from the derived class, by making them private. class base { public: base(...) {...}; /* constructor */ base~(...) {...}; /* destructor */ method(...) {...}; /* other public methods */ private: ... etc. } class child : base { public: ... private: ... } So long as the calling sequence and functionality (interface) of the base class public methods do not change, the implementation of those public methods can change, and the private methods and attributes can change, without impacting any child class.


What bones do not protect an internal organ?

Humans have many bones that don't protect internal organs like your finger bones (which are called phalanges and metacarpals)


What do human bones protect?

Your bones protect your internal organs from injury.


Does all bones protect all internal organs?

no


What protect internal human body?

The Skeletal system


What is skin used for?

To protect our internal organs from germs.


Why do you have ribs?

The ribs support and protect the lungs, and to some extent protect other internal organs.


What is it about an egg that makes it so difficult to protect it from breaking?

it is fragile


Best way to protect a pumpkin from breaking?

Don't drop it.