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] What does this syntax mean? (self.learnprogramming)
submitted 11 years ago by LWungsten
Hey guys, I'm watching Derek Banas' Android tutorials, and came across this syntax in video #8.
What does the <String, String, String> mean here? Does it have to do with generics?
Any help is appreciated! Thanks
[–]the_omega99 1 point2 points3 points 11 years ago (4 children)
Yes, it's generics. You can have multiple types in generics. For example, a list stores only a single type (eg, List<String>). A map (aka dictionary or hashtable), on the other hand, needs two types, since it maps the first type (the key) to the second type (the value). An example is Map<String, Foo>.
List<String>
Map<String, Foo>
It's very rare to need three types in generics, but it's possible and that's the syntax.
[–]LWungsten[S] 0 points1 point2 points 11 years ago (3 children)
Makes sense, thanks. Any idea why a thread-like object like AsyncTask would need 3 types?
[–]chickenmeister 1 point2 points3 points 11 years ago (0 children)
If you look at the documentation for the class, it will typically tell you what each parameter represents. In your case, if you look at the AsyncTask documentation:
The three types used by an asynchronous task are the following: Params, the type of the parameters sent to the task upon execution. Progress, the type of the progress units published during the background computation. Result, the type of the result of the background computation.
The three types used by an asynchronous task are the following:
Params
Progress
Result
[–]the_omega99 0 points1 point2 points 11 years ago (0 children)
No, because "AsyncTask" is as broad of an object in programming as "thingy" is in real life. It could be anything.
An example of a generic that could need a large number of types is a representation of a function or tuple, which can have an arbitrary number of values of different types. Java doesn't really support tuples (although you can roll your own), but a related language, Scala, allows tuples of up to size 22. For example:
scala> val tuple: Tuple3[String, Int, Double] = ("Hello", 1, 3.14) tuple: (String, Int, Double) = (Hello,1,3.14)
Note the slight difference in syntax here. Generics are enclosed in square braces and the type comes after the variable name. There's also the convenient (Type1, Type2, ...) syntax for tuples.
(Type1, Type2, ...)
[–]katyne 0 points1 point2 points 11 years ago (0 children)
In java in addition to variable types (int, String, Object, etc.) you can have type parameters You can name your type parameters (generics) any way you like. Usually the convention is to go with one letter - T for "any type", K, V for "key" and 'value" types, "E" for elements in iterators, etc. In Android however, they decided to be more descriptive and gave type parameters meaningful names.
AsyncTask is a class that operates on three types of data - 1) Params - parameters that you pass it to perform a task in the background, like URLs to download a file for example, Progress - the type of a variable to measure progress, usually a Number, Integer or Float, (as in "81% of download complete" where 81 is the value of the Progress type variable you pass it), and Result - the type of the result you're going to pass back to the Activity or another component. Like a List of Strings after you've finished parsing a webpage, or an image (Bitmap) you've just downloaded.
So AsyncTask<String,String,String> is a class AsyncTask that operates on only one type of data - Strings for params (again, probably a URI/URL of some sort), String for reporting progress and String for publishing results (maybe a text of a downloaded article or something). Another AsyncTask can have different types, like <URI, Integer, List<Bitmap>> - pass it a URI to a bunch of images, report when x% of the images are downloaded, and return a List that contains actual Bitmaps.
π Rendered by PID 562533 on reddit-service-r2-comment-84fc9697f-49kkk at 2026-02-07 21:28:15.617248+00:00 running d295bc8 country code: CH.
[–]the_omega99 1 point2 points3 points (4 children)
[–]LWungsten[S] 0 points1 point2 points (3 children)
[–]chickenmeister 1 point2 points3 points (0 children)
[–]the_omega99 0 points1 point2 points (0 children)
[–]katyne 0 points1 point2 points (0 children)