• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I do not understand what "get(0);" means.

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am having problems understanding the following code any help greatly appreciated as I could not find the answer anywhere. Here is the code




I do not understand the "get(0);" please if anyone can explain that please Thank you. Derek
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you look up the javadoc for the get() method? What aspect is confusing to you?
 
derek smythe
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no I didn't look it up, I was wondering where I can find the javadoc, is there a link to the page please? That would be great. As I can write down the link in the back of my Head First Java book to help me along. I understand it now, get(0) returns the object at element 0 i think, or index 0. I think. But a link to the javadoc would be great as I didn't find anything for google search under java documentation. There is another question I have but it is so complicated that I am not even sure how to phrase the question yet. LOL. thank you. Derek
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a tip: just write the full classpath of a class into a reply, such as

java.util.ArrayList

and voila, it's a link to the javadoc! Cool, no?
 
derek smythe
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Awesome thanks Bear! that is cool. Do you mean that I have to post a reply with the java.util.ArrayList in it to see the link? Also, I was wondering, how do I know what package a certain class native to the java language is in. Once I know how to find the java classes definitions in the documentation, I will be INVINCIBLE. muwahahah. ok any more help greatly appreciated. thank you. Derek

EDIT: Nevermind. I found the link from the one you gave me. This is the main page that will let me help myself hopefully.

java docs
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

derek smythe wrote:I found the link from the one you gave me. This is the main page that will let me help myself hopefully.

java docs



Yup. Make sure you bookmark it. A lot of programmers just leave it permanently open in a browser tab while they are working.

(You asked how to find what package a particular class is in? There's an "Index" link at the top of every single page in the docs.)
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the API documentaton, the fully-qualified name of the class appears at the top left, like this java.laString. The smaller writing is the class name. If you hover the mouse over the name of the class in the lower left pane, a tool tip appears saying "class in java.lang" or similar.
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best way to find the documentation of any java class is to type: java <name of class> into the google search engine, it will usually pop up at or near the top
 
Campbell Ritchie
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I earlier wrote: . . . java.laString. The smaller writing is the class name. . ..

Oops! The larger writing is the class name and the smaller writing is the package name. Sorry for that mistake, which you have doubtless already noticed.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Unnar Björnsson wrote:The best way to find the documentation of any java class is to type: java <name of class> into the google search engine, it will usually pop up at or near the top


Yeah but it's not always the latest version. It'd be best to bookmark the javadoc.
 
reply
    Bookmark Topic Watch Topic
  • New Topic