• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

fetch in integer variable

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to fetch following string array into integer array


i am doing like following


but it is giving compile time error.
 
Ranch Hand
Posts: 1137
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
 
Bartender
Posts: 4568
9
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Integer.parseInt takes a String as the argument, but you're passing it a String array.

To convert an array of Strings into an array of ints, you need to create the int array of the right size, then loop round the arrays converting each individual String to an int.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try this


 
    Bookmark Topic Watch Topic
  • New Topic