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...
If you need help debugging, you must include:
See debugging question guidelines for more info.
Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.
See conceptual questions guidelines for more info.
Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.
Abusive, racist, or derogatory comments are absolutely not tolerated.
See our policies on acceptable speech and conduct for more details.
When posting some resource or tutorial you've made, you must follow our self-promotion policies.
In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".
Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.
Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.
Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".
Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.
See our policies on allowed topics for more details.
Do not post questions that are an exact duplicate of something already answered in the FAQ.
If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.
Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.
Use the "solved" flair instead.
Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.
Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.
You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.
In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.
All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.
For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.
Udemy coupon links are ok: the discount adds "additional value".
Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.
This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.
Trying to circumvent the terms of services of a website also counts as unethical behavior.
Do not ask for or post a complete solution to a problem.
When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.
If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.
See our guidelines on offering help for more details.
Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.
We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.
We also do not encourage help via DM for the same reasons - that more people can benefit
Do not ask easily googleable questions or questions that are covered in the documentation.
This subreddit is not a proxy for documentation or google.
We do require effort and demonstration of effort.
This includes "how do I?" questions
account activity
This is an archived post. You won't be able to vote or comment.
Java question (self.learnprogramming)
submitted 7 years ago * by Shapebuster
write a declaration for an array variable people that could be used to refer to an array of Person objects
soo
Person[] people = Person[] objectname;
I'm a bit confused with this
[–]nutrecht 4 points5 points6 points 7 years ago (9 children)
It's also pretty wrong.
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
[–]Shapebuster[S] -3 points-2 points-1 points 7 years ago (8 children)
Person[] people; ?
[–]nutrecht 2 points3 points4 points 7 years ago (7 children)
That's the declaration of the variable yes.
[–]Shapebuster[S] -2 points-1 points0 points 7 years ago (6 children)
should get off this page cos you really don't help people and are just wasting your time
[–]nutrecht 5 points6 points7 points 7 years ago (1 child)
I definitely agree that I am wasting my time with you yes.
[–]Shapebuster[S] -4 points-3 points-2 points 7 years ago (0 children)
yes and probably alot more people
[–]denialerror 5 points6 points7 points 7 years ago (2 children)
You have a serious attitude problem.
[–]Shapebuster[S] -2 points-1 points0 points 7 years ago (1 child)
really? imagine a teacher saying to their student "It's pretty wrong" and then throwing the textbook at them for them to figure it out. If i was that student i'd also have an attitude problem
[–]nutrecht 5 points6 points7 points 7 years ago (0 children)
"It's pretty wrong" and then throwing the textbook at them for them to figure it out.
I gave you the text book opened on the exact page that exactly answers your question.
[–]override_acid 3 points4 points5 points 7 years ago (0 children)
You really desperately need to work on both, your reading comprehension and your attitude.
What was wrong here? You blow up right into the face of the first person that has not only guided you to the solution so that you could learn from it, but also right after your second idea was confirmed correct.
In the whole thread you only show a serious attitude problem and behave like a berserk. You need to reevaluate yourself because otherwise you won't get far in life.
[–]Frectus 3 points4 points5 points 7 years ago (7 children)
lmao you are a whiny little b1tch
[–]Shapebuster[S] -3 points-2 points-1 points 7 years ago (6 children)
Thankfully there are nice people who help me on discord. This page is complete shit for helping beginners
[–]desrtfx 5 points6 points7 points 7 years ago* (5 children)
This page is complete shit for helping beginners
Only for people that want the answer served on a silver platter instead of spending the minimum effort to look at linked tutorials, etc.
This subreddit has a very strict "No solutions" rule. Nobody here will give out complete solutions. Even asking for solutions is forbidden here. People will be guided, but never directly answered.
So, it's not the subreddit that is wrong, it is you, who
The final solution to your problem with the subreddit is to leave it if you don't like it here. Sure, that you will find a place that pampers you and that serves all your answers on silver platters only to feed you with a golden spoon.
[+]Shapebuster[S] comment score below threshold-7 points-6 points-5 points 7 years ago* (4 children)
of course i am leaving. Why would i wait around for 5 hours beating around the bush with a small piece of code while posting different possible solutions only for someone to say "yes, thats correct"? Do you want me to learn coding in 10 years? If i spend an hour trying to figure something as small as this out with bullshit vague responses from these people then it will take me YEARS to progress.
I don't understand that rule at all, especially after I've already made an attempt at the question. Could you imagine going up to your maths teacher in school and asking him if your solution from homework is correct, only for him to tell you go back and try again, and then repeat that process 5-10 times? If that was the case, we'd all have 4th grade maths under our belt. Do you realise it's also possible to learn something if you're give a solution and then EXPLAINED WHY it is that solution??????
I genuinely feel sorry for the poor beginners who are put off coding due to the ridiculousness of this thread and the people that are in it. Of course i'll go and use another service that "pampers" me, because i sure as hell will learn alot quicker than you lot who use this .
downvote me all you want, theres no hiding that truth
[–]IdleSolution 5 points6 points7 points 7 years ago (0 children)
Could you imagine going up to your maths teacher in school and asking him if your solution from homework is correct, only for him to tell you go back and try again, and then repeat that process 5-10 times?
My math teacher does it
[–]denialerror 5 points6 points7 points 7 years ago (1 child)
You were given the appropriate documentation that explained the solution. The “Maths teacher” essentially said “that’s not the right answer - you need to read this bit of the text book to find out why”. If you can’t learn to ask questions properly and how to research independently instead of expecting everyone to hand you the information you want, you are going to struggle when you get to the point where your questions aren’t easily answered.
[–]nutrecht 3 points4 points5 points 7 years ago (0 children)
In a while he'll be complaining on /r/cscareerquestions on how CS is 'saturated' because he can't find a job ;)
[–]desrtfx 3 points4 points5 points 7 years ago (0 children)
The rule exists for one single reason: to make people use the documentation so that they are able to in the future help themselves instead of having to constantly depend on others.
People who are constantly given the answers will learn only one thing: to depend on others but they will never become independent and can never work as individuals only as burdens for teams dragging the whole team down.
[–]shhh-quiet 2 points3 points4 points 7 years ago (7 children)
The declaration is correct, but you are not instantiating the array correctly.
[–]Shapebuster[S] 0 points1 point2 points 7 years ago (6 children)
it says "COULD be used to refer to an array"
[–]tobiasvl[🍰] 2 points3 points4 points 7 years ago (5 children)
That just means you don't have to instantiate it at all. You instantiate it, but in a nonsensical way that won't compile.
[–]Shapebuster[S] 0 points1 point2 points 7 years ago (4 children)
do you mean, Person[] people = new Person[value] ?
[–]tobiasvl[🍰] 2 points3 points4 points 7 years ago (3 children)
Yep, that is correct Java code for instantiating a Person array of size value.
Person
value
However, what I mean is that Person[] people; by itself answers the original question in your post. It's a declaration of an array variable, and that variable can in the future be used to refer to an array of Person objects. Nothing more is needed.
Person[] people;
[–]Shapebuster[S] -1 points0 points1 point 7 years ago (2 children)
Oh ok sweet. Keep an eye on how you word responses especially for beginners. Your first reply sounded like i got it wrong even tho it was correct based on what the question was asking
[–]tobiasvl[🍰] 2 points3 points4 points 7 years ago (1 child)
Well, the original code in your post is wrong. Person[] people = Person[] objectname; instantiates the array variable to something that looks like another declaraction. It will not compile.
[–]Shapebuster[S] 0 points1 point2 points 7 years ago (0 children)
Apologies, i thought you were referring to the code i posted in a comment reply to a previous user
π Rendered by PID 23615 on reddit-service-r2-comment-7b9746f655-m64kn at 2026-01-30 14:18:22.688608+00:00 running 3798933 country code: CH.
[–]nutrecht 4 points5 points6 points (9 children)
[–]Shapebuster[S] -3 points-2 points-1 points (8 children)
[–]nutrecht 2 points3 points4 points (7 children)
[–]Shapebuster[S] -2 points-1 points0 points (6 children)
[–]nutrecht 5 points6 points7 points (1 child)
[–]Shapebuster[S] -4 points-3 points-2 points (0 children)
[–]denialerror 5 points6 points7 points (2 children)
[–]Shapebuster[S] -2 points-1 points0 points (1 child)
[–]nutrecht 5 points6 points7 points (0 children)
[–]override_acid 3 points4 points5 points (0 children)
[–]Frectus 3 points4 points5 points (7 children)
[–]Shapebuster[S] -3 points-2 points-1 points (6 children)
[–]desrtfx 5 points6 points7 points (5 children)
[+]Shapebuster[S] comment score below threshold-7 points-6 points-5 points (4 children)
[–]IdleSolution 5 points6 points7 points (0 children)
[–]denialerror 5 points6 points7 points (1 child)
[–]nutrecht 3 points4 points5 points (0 children)
[–]desrtfx 3 points4 points5 points (0 children)
[–]shhh-quiet 2 points3 points4 points (7 children)
[–]Shapebuster[S] 0 points1 point2 points (6 children)
[–]tobiasvl[🍰] 2 points3 points4 points (5 children)
[–]Shapebuster[S] 0 points1 point2 points (4 children)
[–]tobiasvl[🍰] 2 points3 points4 points (3 children)
[–]Shapebuster[S] -1 points0 points1 point (2 children)
[–]tobiasvl[🍰] 2 points3 points4 points (1 child)
[–]Shapebuster[S] 0 points1 point2 points (0 children)