Skip to main content
Post Reopened by Boann java
Source Link
Boann
  • 50.3k
  • 16
  • 125
  • 153

How JAVA differentiates betweendoes Java protect private,public package-private, and protected variables?

I am new to JAVAJava programming and have a couple of questionsquestion that I have been curious about. Any help will be appreciated :)

1)How does the differentiation betweenare private,public and package-private, protected, and public variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA differentiated behind the scenes, so as to keep private variables safe?? 

By safe I mean it's basic function as "notfor example, how does it make sure that private variables are accessible directly withoutonly to methods inside the object/class".class?

(Does JAVA has I want to know what actually happens inside the computer/JVM. Does Java have a different memory space for each of these types? andAnd if so and what makes itthe different memory spaces inaccessible? After all it is still in the memory right?)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

Thank you in advance Thank you in advance :-):-)

How JAVA differentiates between private,public and protected variables?

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

1)How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

Thank you in advance :-)

How does Java protect private, package-private, and protected variables?

I am new to Java programming and have a question that I have been curious about. Any help will be appreciated :)

How are private, package-private, protected, and public variables differentiated behind the scenes, so as to keep variables safe? 

By safe I mean for example, how does it make sure that private variables are accessible only to methods inside the class?

I want to know what actually happens inside the computer/JVM. Does Java have a different memory space for each of these types? And if so what makes the different memory spaces inaccessible? After all it is still in the memory right?

Thank you in advance :-)

Post Closed as "Duplicate" by CommunityBot
added 2 characters in body
Source Link

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

1)How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

Thank you in advance :-)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

1)How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

Thank you in advance :-)

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

1)How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

Thank you in advance :-)

added 151 characters in body
Source Link

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

**1)**How does the differentiation1)How does the differentiation between private,public and protected variables variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

**2)**2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

Thank you in advance :-)

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

**1)**How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

**2)**How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

Thank you in advance :-)

NOTE:I want to know what happens actually "inside the computer/JVM/behind the scenes" and not just what each type of variable are used for.

I am new to JAVA programming and have a couple of questions that I have been curious about. Any help will be appreciated :)

1)How does the differentiation between private,public and protected variables take place in JAVA behind the scenes/(actual stuff that goes inside the computer)?

2)How does JAVA keep private variables safe? By safe I mean it's basic function as "not accessible directly without methods inside the object/class".

(Does JAVA has different memory space for each of these types? and if so and what makes it inaccessible? After all it is still in the memory right?)

Thank you in advance :-)

Source Link
Loading