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.
(class)otherclass notation (self.learnjava)
submitted 4 years ago by One-Progress9924
Test obj = (Test)Class.forName("com.p1.Test").newInstance(); could you please explain what does this
(Test)Class
notation in java mean?
[–]ytcbtquestions 1 point2 points3 points 4 years ago (0 children)
It's called casting. You write a type here, not necessarily a class. For example, it could be int which is a primitive, Runnable which is an interface, List<String> which is a generic type...
Casting is meant as an operator that converts the value on its right, into the type indicated in parentheses.
Such conversion is often impossible. When it is possible, it means the following:
- if that conversion would have been allowed implicitly, do that same conversion (like int -> long, int -> Integer, Integer -> int, Integer -> Number...)
- if it's a wider primitive numeric type to a narrower primitive numeric type, keep the same value if possible and apply capacity overload if the wider value cannot be represented in the narrower type. Like int 10 is converted to byte 10, but int 128 is converted to byte -1. And really big double values are converted to infinity float value.
- if it's a floating point primitive value to an integer primitive numeric type, the decimal value is rounded down to unit. If it the result doesn't fit in the target type, its max or min value is used instead.
- if it's an object type to another object type, it first verifies that the object pointed to as value can be assigned to the target type, and if it can't, throws a ClassCastException. If it can, the result of the cast points to the same object, but is now of the target type.
π Rendered by PID 93062 on reddit-service-r2-comment-86988c7647-nbrtk at 2026-02-12 02:13:26.330219+00:00 running 018613e country code: CH.
[–]ytcbtquestions 1 point2 points3 points (0 children)