public class Test {
	public static method1(int n, m){
		n += m;
		method2(3.4);
	}
	
 public static int method2(int n){
 	if (n > 0)return 1;
	else if (n == 0) return 0;
	else if (n < 0) return -1; 
 }
}

Recommended Answers

All 3 Replies

why do you write method two to accept integers and then pass it a float?

Agree with pinsickle, either change your message signature or make sure the argument you pass to it is the primitive type expected - i.e. int.

Also method1 doesn't have a return type. If you don't intend to return anything, make it void.

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.