Given:
1. package test;
2.
3. class Target {
4. public String name = “hello”;
5. }
What can directly access and change the value of the
variable name?
1 any class
2 only the Target class
3 any class in the test package
4 any class that extends Target
Answer Posted / manikandan [ gtec,vellore ]
Public is Visible to everywhere.
Private is visible to only the same class.
Protected is visible in same package and also sub classes in
any package.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Does treeset allow null in java?
What is the length of a string?
When arithmeticexception is thrown?
Explain the overview of UDP messaging.
What are the differences between heap and stack memory in java?
describe synchronization in respect to multithreading? : Java thread
What is a bubble sort in java?
Which is better arraylist or vector?
What does || mean in vectors?
What are 4 pillers of object orinted programming?
How many days will it take to learn java?
Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).
What is the difference between final, finally and finalize()?
What does g mean in regex?
Write a program based on Java script program.