public class Main{
public static void main(String[ ] args) throws Exception{
System.out.println( tri(1,3) );
}
public static String tri(int x, int y){
return x*y/2;
}
}
So, the output should be the code The blanks in question are in the 6th and 7th lines
public < > < > tri(< >x, int y){ < > x*y/2; } In , the < > parts were blank.
The error code that came out when I executed is
Type mismatch: cannot convert from int to String
That's it. What's the answer? What is the problem with my code?
java
I changed the string to int, so it was solved right away!
© 2024 OneMinuteCode. All rights reserved.