Create a class SameNumbers with a public method checkNumbers that takes two parameters firstNo and secondNo are of type int and returns true if firstNo and secondNo are equal. The return type of checkNumbers should be boolean.
For example:
Cmd Args : 10 10 true
Cmd Args : 2 3 false
Solution:
package q10864;
public class SameNumbers {
/**
* Check if the two numbers are equal or not
*
*
*
* @return result
*/
public boolean checkNumbers(int firstNo, int secondNo) {
//Write your code here
if (firstNo == secondNo) {
return true;
}
else{
return false;
}
}
}
Candidates having any kind of query so he/she can ask in our comment section. Our Panel will b reverting back as soon as possible. Thank You. For more details visit our website (https://speedjobalert.com/)