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

Comparing a value to the elements in Array  RSS feed

 
Terence hiu
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to compare the bellow variable y with the elements in x, if y matches a element in x then print something. Without looping though each elements in the array, is there another way of comparing?

 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Terence

You may consult the java.util.Arrays API for your answer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!