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 is a parameter in java?
Java is pass by value or pass by reference? Explain
What kind of variables can a class consist?
Can we compare two strings in java?
Do I need java on my computer?
Why method overriding is used?
Does java map allow duplicates?
How do you insert a line break?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
Which is better singleton or static class?
How many ways can an argument be passed to a subroutine and explain them?
Is set ordered?
Is treeset sorted in java?
How do you sort a string in java?
What is a generic data type?