• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compare Normal variable to an Array  RSS feed

 
vivek nehra
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to compare normal variable  to an array is it possible for e.g



is it possible ?
 
Stephan van Hulst
Saloon Keeper
Posts: 7962
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

What will you do if the array contains two elements?
 
Brian Dady
Greenhorn
Posts: 4
Java jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to accomplish? Perhaps there's a better way of doing this.
 
vivek nehra
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want if user enter numbers from 1 to 10 in textfield ...the color of next textfield will chngd ....
 
Brian Dady
Greenhorn
Posts: 4
Java jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vivek nehra wrote:i want if user enter numbers from 1 to 10 in textfield ...the color of next textfield will chngd ....


It sounds like maybe you want to know if the array contains the value stored in the variable.

http://stackoverflow.com/questions/12020361/java-simplified-check-if-int-array-contains-int
 
salvin francis
Bartender
Posts: 1649
37
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vivek nehra wrote:i want if user enter numbers from 1 to 10 in textfield ...the color of next textfield will chngd ....

Could you explain your requirement a bit more in depth?

First of all, you mentioned numbers (plural). What color will the next textfield be if the user enters "1,3,4" (assuming comma as separator) ?
How is this related to your original question of comparing a variable with an array ?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!