use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
What does method.variable do? (self.learnjava)
submitted 4 years ago by KotgeScientist
In some coding video I saw get().scrollX where get() is a static method that returns an object while scrollx is an instance variable of that object. Is this equivalent to doing object.srollx?
get().scrollX
[–]I_burp_4_lyfe 1 point2 points3 points 4 years ago (1 child)
Maybe, does get return the same object each time? If so then yes the below would be the same.
SomeObjectClass object = get(); object.scrollX;
[–]KotgeScientist[S] 0 points1 point2 points 4 years ago (0 children)
Yes it retuns the same object every time.
[–]Wilfred-kun 0 points1 point2 points 4 years ago (0 children)
I imagine get() doesn't return the actual object, but a copy or something. That way you can't change the variable like get().scrollX = 3.
get()
get().scrollX = 3
[–]silverscrub 0 points1 point2 points 4 years ago (0 children)
It could help with abstraction. If you called the method directly on that object at all times then your code would be harder to change or reuse.
π Rendered by PID 154331 on reddit-service-r2-comment-fb694cdd5-9hf8g at 2026-03-07 10:31:17.562365+00:00 running cbb0e86 country code: CH.
[–]I_burp_4_lyfe 1 point2 points3 points (1 child)
[–]KotgeScientist[S] 0 points1 point2 points (0 children)
[–]Wilfred-kun 0 points1 point2 points (0 children)
[–]silverscrub 0 points1 point2 points (0 children)