answersLogoWhite

0

If you omit either the "public" or the "private" keywoard, the access (to a field or method) will be the so-called "default access". The field or method will be visible for other classes, if they are in the same package.

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Engineering

Why you need to declare main method as public static void main what happens if the method as private and non static?

That would require a detailed explanation of each of the keywords involved; if you are just starting to learn Java, suffice it to say that the Java Virtual Machine looks for a method that has that precise signature. As to what happens if you do otherwise, try it out! Probably you will get different error messages, depending on what keywords you omit or change.


Why java is an extensible programming language?

By connecting to the Internet, a user immediately has access to thousands of programs and other computers .During the execution of a program, Java can dynamically load class libraries that it requires either from the local hard drive, from another computer on the local area network or from a computer somewhere on the Internet.


What is the default return type of a function?

The normal exit of program is represented by zero return value. If the code has errors, fault etc., it will be terminated by non-zero value. In C++ language, the main() function can be left without return value. By default, it will return zero. To learn more about data science please visit- Learnbay.co


Design an algorithm that prompts the user to enter his or her height and stores the user's omit om a variable named height?

enter five feet eight inchies and store the input


Which is type casting operator in java?

It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.It means to explicitly convert to a certain type.double a = 5.0;int b;b = (int) a;The (int) is the explicit typecast in this case, but any type can be used, including a user-defined type (i.e., a class name). If you omit it, the compiler will complain, because when you convert a double to an int, precision may be lost. If you include it, you override this compiler check - you basically tell the compiler that you know what you are doing.

Related Questions

How do you create a class in c sharp having constructor defined in it?

the constructor has the same name as the class name, but no return type (not even with void). Example of a class named Car, with 2 constructors public class Car { public Car() {} public Car(int numberOfWheels) {// code omit } // code omit }


Why you need to declare main method as public static void main what happens if the method as private and non static?

That would require a detailed explanation of each of the keywords involved; if you are just starting to learn Java, suffice it to say that the Java Virtual Machine looks for a method that has that precise signature. As to what happens if you do otherwise, try it out! Probably you will get different error messages, depending on what keywords you omit or change.


What part of speech is omit?

The word omitting is a verb. It is the present participle of omit.


What is the word for omit in French?

To omit is 'omettre' in French.


A sentence using the word omit?

the message was omit


How do you make a sentence with omit?

i omit at school lol


How do you put omit into sentence?

To omit means to leave out. Here are some sentences.Don't omit my name from the invitation this time.If you're not careful, you might omit something important from your report.We will omit anything that is offensive before we publish the article.


What is the root word of the word omitted?

The root word of "omitted" is "omit." "Omit" means to leave out or exclude something.


What is a sentence using the word omit?

omit your homework again. And you loose your grades.


How To omit duplicates from a query?

Put a minus sign before what you want to omit


Does omit mean the same as obey?

Omit similar to remove, erase, exclude.


Use omit in a sentence?

I will omit the words from the paragraph, which means I will leave them out.