answersLogoWhite

0

To prevent a subclass from inheriting those.

A subclass will inherit public and protected members of it's superclass. Package-private members will only be inherited for subclasses in the same package.

consider:

class car{

static public numberBuilt = 0;

public car(){

numberBuilt++;}

/**********/

class raceCar{

public raceCar(){

numberBuilt++;}}

/*

* If numberBuilt had been declared as private, an error would be caused

* by raceCar's use of numberBuilt, influencing a programmer to make a new

* static numberBuilt variable for CarRacecar and other extensions of Car, and

* showing that other things are deprecated. */

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Who make Java Program?

Many people make Java programs, but if you mean who invented the Java programming language it was James Gosling of Sun Microsystems.


How do you make the people who you follow on Instagram private?

you cannot make other people private only yourself


How do people make minecraft mods?

They program them using code and Java.


When creating a Bean how do you make its properties available to all possible users?

Declare the Bean's fields "public."Java 2, Question 10 of 40


What is heritance in java?

With inheritance, you can use methods and fields from the superclass in a subclass. So for example when I have a class Person with fields age and gender, I can make a subclass Student. a Student object has always the fields from its superclass Person (age and gender), but you can make extra fields for a Student object. The same is true for methods: a method defined in the Person class can also be used on a Student object because Student is a subclass from Person. Got it? ;)


What does the java script can do?

when you put it in a coffemaker, and put hot water w/ the java beans, you may make a java latte' .but make sure you have whipped cream to make the flavor balanced.


How do you let java into your firewall?

To allow Java through your firewall, you need to create an exception for the Java application in your firewall settings. This usually involves accessing the firewall configuration, navigating to the "Allowed Apps" or "Exceptions" section, and adding the Java executable (java.exe) or the specific Java application you want to allow. Make sure to specify the appropriate network types (private, public) for the exception. After saving the changes, restart the firewall if necessary to apply the new rules.


Am doing mca3rd year i doubt about what course like JAVA or .NET SIR but i think choose java what about the JAVA what java?

Yes you should go with java, it is used much more than .net currently. Java gets its name from Sun Java how owns java. Before java was released to the public it was called oak because of an oak tree outside of the office of the person who created it. Some people think it got its current name because oak is not a good name for a language, and that it took lots of coffee (java) to make java.


Do people need to do something to make a baby?

yes they do but its private


Why do you need java for Facebook?

I am not sure whether you actually need it, perhaps you do. The point is, if any Web site has Java applets - components programmed for Java - then the user must install Java to make it work. Java (and alternative technologies, such as Flash, or SilverLight) make it possible to make "richer" Web pages, i.e., Web pages with more options, and a better visual presentation.I am not sure whether you actually need it, perhaps you do. The point is, if any Web site has Java applets - components programmed for Java - then the user must install Java to make it work. Java (and alternative technologies, such as Flash, or SilverLight) make it possible to make "richer" Web pages, i.e., Web pages with more options, and a better visual presentation.I am not sure whether you actually need it, perhaps you do. The point is, if any Web site has Java applets - components programmed for Java - then the user must install Java to make it work. Java (and alternative technologies, such as Flash, or SilverLight) make it possible to make "richer" Web pages, i.e., Web pages with more options, and a better visual presentation.I am not sure whether you actually need it, perhaps you do. The point is, if any Web site has Java applets - components programmed for Java - then the user must install Java to make it work. Java (and alternative technologies, such as Flash, or SilverLight) make it possible to make "richer" Web pages, i.e., Web pages with more options, and a better visual presentation.


Why people generally use oracle as backend of java projects?

there are certain rules to make up a relational data base management system, oracle follows it and so its an rdbms


What is Difference between java and core java?

Java or Java SE comes with the standard library, with all the crazy classes to make life easy. Java Core does not come with most of these classes, so that it is a lot smaller.