DUET PG Score Card 2021
NHAI Recruitment 2021
Bihar Board 12th Dummy Admit Card 2022
RBI Assistant Notification 2021
Jee Advanced 2021 Result
NIACL Assistant Recruitment 2021
SBI PO Online Form 2021

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

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/)

Leave a Comment