Computer Applications
The access modifier that gives least accessibility is:
- private
- public
- protected
- package
Encapsulation & Inheritance in Java
ICSE 2022
9 Likes
Answer
private
Reason — A data member or member method declared as private is only accessible inside the class in which it is declared. Thus, it gives the least accessibility.
Answered By
7 Likes
Related Questions
Give the output of the following code:
System.out.println("Good".concat("Day"));
- GoodDay
- Good Day
- Goodday
- goodDay
A single dimensional array contains N elements. What will be the last subscript?
- N
- N - 1
- N - 2
- N + 1
Give the output of the following code :
String A = "56.0", B = "94.0"; double C = Double.parseDouble(A); double D = Double.parseDouble(B); System.out.println((C+D));
- 100
- 150.0
- 100.0
- 150
What will be the output of the following code?
System.out.println("Lucknow".substring(0,4));
- Lucknow
- Luckn
- Luck
- luck