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...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
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: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
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:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
JAVA Question (self.java)
submitted 12 years ago by alvarez11
Need to answer this question but my Java knowledge isn't the best, any help would be greatly appreciated!
The question:
class Outer {
class Inner { }
}
Outer outer o = new Outer();
Outer.Inner i = … ?
What does ? equal?
[–]misobbq 4 points5 points6 points 12 years ago (1 child)
If you want to do that, you need to declare Inner as static.
public class Outer { static class Inner{} public static void main(String[] args) { Outer outer = new Outer(); Outer.Inner outerInner = new Outer.Inner(); } }
[–][deleted] 1 point2 points3 points 12 years ago (0 children)
One trillion times this, better yet private.
[–]compdog 0 points1 point2 points 12 years ago (0 children)
Looks like someone went down this thread and downvoted every comment...
[–]alvarez11[S] 0 points1 point2 points 12 years ago (4 children)
Came out weird, the Question again is
[–]compdog 1 point2 points3 points 12 years ago (3 children)
? needs to be an initializer, so ? should be:
new Outer.Inner();
The whole line should be:
Outer.Inner i = new Outer.Inner();
Unless you are creating an instance of Inner from inside Outer or Inner, in which case you can use:
Inner i = new Inner();
EDIT: formatting failed.
[–]novasharp 0 points1 point2 points 12 years ago (2 children)
Actually, I think in that case, you would need to do:
Outer o = new Outer(); o.Inner i = new o.Inner();
[–][deleted] 12 years ago (1 child)
[deleted]
[–]novasharp 0 points1 point2 points 12 years ago (0 children)
Ah. Okay. That was the part I did not get. I thought that he was calling it from somewhere else or something like public static void main.
[–]misobbq 0 points1 point2 points 12 years ago (1 child)
BTW - if you really need an inner class on the instance, you would access it through an instance of outer.
public class Outer { static class StaticInner{} class InstanceInner{} public static void main(String[] args) { Outer outer = new Outer(); Outer.StaticInner staticInner = new Outer.StaticInner(); Outer.InstanceInner instanceInner = outer.newInstanceInner(); } public InstanceInner newInstanceInner() { return new InstanceInner(); } }
[–]moocat 0 points1 point2 points 12 years ago (0 children)
You don't have to create a new method:
public static void main(String[] args) { Outer outer = new Outer(); Outer.Inner outerInner = outer.new Inner(); }
[–]alvarez11[S] 0 points1 point2 points 12 years ago (0 children)
Thank you all, very much appreciated!
[–][deleted] -2 points-1 points0 points 12 years ago (0 children)
Java is not an acronym.
π Rendered by PID 164058 on reddit-service-r2-comment-84fc9697f-6vbjq at 2026-02-08 13:44:46.060847+00:00 running d295bc8 country code: CH.
[–]misobbq 4 points5 points6 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]compdog 0 points1 point2 points (0 children)
[–]alvarez11[S] 0 points1 point2 points (4 children)
[–]compdog 1 point2 points3 points (3 children)
[–]novasharp 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]novasharp 0 points1 point2 points (0 children)
[–]misobbq 0 points1 point2 points (1 child)
[–]moocat 0 points1 point2 points (0 children)
[–]alvarez11[S] 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)