This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about arrays

 
saima kanwal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
consider the following code:



this does not compile. Can anyone tell me what is the problem with this code. Actually what i feel is that there is some problem when i assign the {1,5} array to c.arr in the main. but if i initialize it at the time of declaration , it works fine. but on the other hand this is not the case with the int num variable.why is that happening??




 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change line 7 to

 
saima kanwal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. i got my mistake.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic