| |

VerySource

 Forgot password?
 Register
Search
View: 635|Reply: 2

Novice ask you some experts ~~ Thank you

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-5 19:30:02
| Show all posts |Read mode
1. What does it mean that immutable classes are not shared by reference? I read a sentence in the book
2. How to interpret static fields? I do n’t understand the book
thank you all
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Korea, Republic of

Post time: 2020-1-7 09:54:01
| Show all posts
1. Generally refers to the final class
    final class a {
}
Such classes are not allowed to inherit.
final data is a "compile-time constant" that never changes
The final method is to lock the method to prevent any class from modifying its meaning.
The final parameter is the object to which the parameter reference cannot be changed in the method

2.static
Static field
Generally, the static method we commonly use is not a THIS method.
Its methods cannot call non-static methods internally, in turn, in non-
Static methods can call static methods internally, it is not sent through the object
Send message
A bit like global functions in C.
The other is static data, and his initialization is not much different from general data.
Just added a static. As for the memory, I think it looks like
Static storage (always existing data), while the java object itself is not stored
Here it is.


I only watch JAVA for two weeks, so I don't understand a lot, just communicate.
Please advise
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-14 18:54:01
| Show all posts
Thank you ~~ I just started it ~ I only watched for a few days ~
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list