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


Please Help Members By Posting Answers For Below Questions

Does treeset allow null in java?

715


What is the length of a string?

751


When arithmeticexception is thrown?

810


Explain the overview of UDP messaging.

922


What are the differences between heap and stack memory in java?

772


describe synchronization in respect to multithreading? : Java thread

715


What is a bubble sort in java?

738


Which is better arraylist or vector?

798


What does || mean in vectors?

713


What are 4 pillers of object orinted programming?

782


How many days will it take to learn java?

708


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).

2459


What is the difference between final, finally and finalize()?

787


What does g mean in regex?

753


Write a program based on Java script program.

859