answersLogoWhite

0

What does private int mean in java?

Updated: 8/11/2023
User Avatar

Wiki User

10y ago

Best Answer

The private keyword denotes that the field or method is hidden from view of any other class.

class MyClass {

private int n; // n cannot be accessed by any class except MyClass

private void doSomething(){} // doSomething cannot be accessed by any class except MyClass

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

were do cro-magnon

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does private int mean in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is getters in java?

GETters and SETters are functions that GET and SET the value of a private variable.example:.........private int power;// -----------------------......................................................... // |.......................................................... // |........................................................... // |........................................................... // | The User Gets The value of power.......................................................... // |public int getPower(){ //...................... |return power;//


What does get mean in java and what is the function of it?

Instead of using public variables, people have a tendency to use it as private variable (They call it encapsulate) and only allow other access these variable via getters and setters. For example: class Calculator { private int a; public int getA(){ return a; } public void setA(int a){ this.a = a; } }


What is a int in java?

int is integer which means datatype


What is a variable type in Java?

int


How are java program statements terminated?

Each statement in Java ends with a semicolon, for example: int a; a = 5; int b = 10;


Is unsigned int var valid in java?

No. Java uses no unsigned numbers.


What is the abbrevations for int?

"int" is the abbreviation for an integer data type. In Java an int is specifically a 32-bit signed integer.


Write aprogram to print number between20 and30?

In Java, put the following within the main() method:for (int i = 20; i


Change int to string in java?

String.valueOf(number);


What is a simple java code and explain what the code does?

int a;This simple Java statement declares an integer.


How do you convert string to int in Java?

One can convert a string variable to an int variable in Java using the parse integer command. The syntax is int foo = Integer.parseInt("1234"). This line will convert the string in the parenthesis into an integer.


Using conditional operator find a biggest number among two numbers?

Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);Here is an example in Java: int a = 5; int b = 7; System.out.println(a > b ? a : b);