Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i dont know how can i do .Java language  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have 1 array with 10 positions .In each position i have a student How can i refer to the array[5] ? to discribe him ?
 
Campbell Ritchie
Marshal
Posts: 55698
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

You can simply write
myArray[5]
You do realise that will give you the 6th value?
Try reading the Java™ Tutorials section about arrays.
 
Campbell Ritchie
Marshal
Posts: 55698
163
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try System.out.println(myArray[5]); and tell us what happens.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!