Forums Register Login

Byte Wrapper class

+Pie Number of slices to send: Send
Hi all,

I am trying to do this,

but it's giving me a compilation error as constructor Byte(int) is not defined. Why is it taking 10 as an int? But when I do this, it's working!!


Can someone tell me why?/

Thanks.
+Pie Number of slices to send: Send
because literals are taken as ints by default. The compiler is smart enough to figure out that

byte b=10;

is ok. However, there is no constructor for a Byte that takes an int, so it fails.
+Pie Number of slices to send: Send
I did not know literals are take int by default. Thanks for the reply Fred.
Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1967 times.
Similar Threads
wrapper classes
Easy Queries
What's wrong with the program?
image is not beeing drawn
var args method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:32:55.