Forums Register Login

loop in construcor

+Pie Number of slices to send: Send
Hi,

I found the following in mock exam. I thought it would print 0, 1. It compiles fine but no output. What feature of language is being tested here ? Please help


Thanks
+Pie Number of slices to send: Send
Well in the loop they are showing you how to use continue with a labeled loop. However, because you never create an instance of Selby, nothing happens.
+Pie Number of slices to send: Send


Try that and see what happens.

-Cameron McKenzie
+Pie Number of slices to send: Send
 

What feature of language is being tested here ? Please help



Want to test calling of Constructor
+Pie Number of slices to send: Send
Thanks all. I missed the minor but important detail.
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 516 times.
Similar Threads
Object Casting - Wyh is "i = 0"
Problem with return statement....
throw vs throws
static methods
where its going wrong ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:18:27.