Hi,

I am getting an error "Illegal Start of Expression" on the following code:

obj.NoOfJumps(1, 2, 3, {1,2,3});

Here, NoOfJumps is a method defined in a class which does not have the main method. This method accepts 4 arguments namely

1)Integer
2)Integer
3)Integer
4)Integer Array


Can someone please explain why this error is coming up and what is the resolution for this?

Thanks

If you wish to initialize a new array like that you will need to state it like

new int[]{ ... }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.