File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question about arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question about arrays" Watch "question about arrays" New topic

question about arrays

saima kanwal
Ranch Hand

Joined: Oct 05, 2009
Posts: 148
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??

SCJP 6.0 (86%) SCWCD 5 (94%)
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

change line 7 to

SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
saima kanwal
Ranch Hand

Joined: Oct 05, 2009
Posts: 148
thanks. i got my mistake.
I agree. Here's the link:
subject: question about arrays
It's not a secret anymore!