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 / kumar
By default,the package and class are public.the result will
be 4 any class that extends Target.
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
what are Hostile Applets?
What does escaping a character mean?
What is java and their uses?
What mechanism does java use for memory management?
In Java list the methods that can be overridden?
What does this () mean in java?
What are different data types?
How do you use parseint in java?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
What is the vector class in java programming?
What is native code?
Are arrays dynamic in java?
What are void methods?
Write a program to print 15 random numbers using foreach of java 8?
Can we have any code between try and finally blocks?