[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

10 / 64

What can directly access and change the value of the variable name?

package test;
class Target {
 public String name = "hello";
}

Aany class

Bonly the Target class

Cany class in the test package

Dany class that extends Target

Answer: Option (Login/Signup)

Show Explanation

Now, the features of a class with default access specifier is-

1. It can be accessed by same package subclass.

2. It can be accessed by same package non-subclass.

Apart from this, no other subclass or non-subclass of some other packages can access this class.

Asked In :: Virtusa

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here