answersLogoWhite

0

default is used with (switch statement) to handle what'll happen if non of the defined cases happened.

ex:

int x=4;

switch(x)

{

case 1: cout<<"1"; break;

case 2: cout<<"2"; break;

case 3: cout<<"3"; break;

default : cout<<"It's not 1 or 2 or 3 ..! ";

}

in that case .. we'll see (It's not 1 or 2 or 3 ..!)

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the use o keyword import?

When we want to use classes of packages other than the default package and java.lang, we should import them. Example : import java.util.Scanner;


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

default


Why don't use abstract keyword when we declare a method in interface?

The abstract keyword signifies that the particular method will have no features in the class where it is declared and it is upto the child class to provide the functionality. In case of an interface, the method is already abstract by default and has no code inside it. So there is no actual point in using the abstract keyword there.


Can I use your keyword in my question?

Yes, you can use the keyword in your question.


Is it okay to use the keyword in this context?

Yes, it is appropriate to use the keyword in this context.


What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


Which keyword do you use to deallocate memory that has been assigned to a stream object?

Delete keyword


Can I use the keyword in an argumentative essay?

Yes, you can use the keyword in an argumentative essay as long as it is relevant to the topic and supports your argument effectively.


What are the two properties of the keyword?

The two properties of a keyword are its relevance to the topic and its frequency of use in a text.


What is the purpose of transient keyword in Java?

A variable which is declared as transient will not be serialized. This means that when you use an ObjectOutputStream to store the current state of a class, anything labeled as transient will be skipped over.A common use of this keyword is to ensure that sensitive user information (usernames, passwords, etc.) is not accidentally saved to a file.


Can you declears static in a local variable in a method in java?

we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....


Can I use the keyword "technology" in my essay about the impact of modern technology on society?

Yes, you can use the keyword &quot;technology&quot; in your essay about the impact of modern technology on society.