• 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