Avatar of GrantYung
GrantYung

asked on 

Q about default attribute type

If I define a class like :
public class A
{
  int x;
  public getx()
  {
     return x;
  }
}
What is the type of variable x? Is it public, private or protected?
Java

Avatar of undefined
Last Comment
GrantYung
Avatar of GrantYung
GrantYung

ASKER

simple question
Avatar of imladris
imladris
Flag of Canada image

Not even 1 point?
Avatar of GrantYung
GrantYung

ASKER

But what is the answer?
Avatar of GrantYung
GrantYung

ASKER

Adjusted points from 0 to 3
ASKER CERTIFIED SOLUTION
Avatar of imladris
imladris
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of GrantYung
GrantYung

ASKER

Answer accepted
Avatar of GrantYung
GrantYung

ASKER

Thanks. So it is package level not private,public or protected.
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo