Problem covert script c# to java

Hi
or need to successfully convert this line of code from c # to java:

public int DealDamage( int amount , int element , bool physic){
int damage = 0;
if(physic){
damage = originalBody.GetComponent().OnDamage(amount , element);
}else{
damage = originalBody.GetComponent().OnMagicDamage(amount , element);
}

	return damage;
	
}

}

or tried to convert java in this world but not of the correct all my problem is the first string:

function  DealDamage( amount : int,   element : int   ,  physic : float ){
		 var damage : int = 0;
		if(physic){
			damage = originalBody.GetComponent(Status).OnDamage(amount , element);
		}else{
			damage = originalBody.GetComponent(Status).OnMagicDamage(amount , element);
		}

		return damage;
		
	}

if there was someone willing to help me I would be very grateful

Your “physic” argument was a boolean, not a float, you also should(it’s not required but makes it more readable) define the return value(and int type) for your function.

function DealDamage(amount : int, element : int, physic : boolean ) : int {
	var damage : int = 0;
		
	if(physic) {
		damage = originalBody.GetComponent(Status).OnDamage(amount , element);
	} else {
		damage = originalBody.GetComponent(Status).OnMagicDamage(amount , element);
	}

	return damage;
}