How does the java compiler knows that i have to hold 41 as value in this method--> public static double convertCelsiusToFahrenheit(int celsius)
what is the rule behind that every time i get confused in programs when i see this please make me clear.
How value is being passed
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Stephen Haokip
18 October 2020, 14:09
suppose i have a method
public static int add(int a, int b){
return a+b;
}
now i call that method by writing the name of the method and the parameters in brackets like this
add(5, 8);
0
Stephen Haokip
18 October 2020, 08:17
your question is confusing
0
Dinesh
18 October 2020, 08:34
Please refer the code. Now it might be helpful to overcome your confusion.
public class Solution{
public static void main(String[] args) {
System.out.println(convertCelsiusToFahrenheit(41));
}
public static double convertCelsiusToFahrenheit(int celsius) {
//write your code here
double TF=9/5.0*celsius+32;
return TF;
}
}
0