On Sat, Mar 08, 2014 at 01:55:00PM -0800, Ming-Ho Yee wrote:
> The Joos Languages page says that array method calls are not supported:
>
> public class A {
> public void m() {
> int[] x = new int[42];
> x.clone(); // Not supported in Joos
> }
> }
Correct: this is not allowed in Joos.
> However, array types are subclasses of java.lang.Object, and furthermore, can be assigned to the java.lang.Object type.
>
> I suspect that the following is valid, since I can't find anything that rules it out, but I'd like some confirmation.
>
> public class A {
> public void m() {
> int[] x = new int[42];
> Object o = x;
> o.toString(); // Is this valid Joos?
> }
> }
Correct: this is allowed in Joos. However, you should not need to worry
about it until you get to code generation, Assignment 5.