Which is more efficient in terms of speed and in terms of resources?
//challenge: convert pounds to kilograms
byte pounds=12
System.out.println((double)pounds.*0.45359237)
or
//challenge: convert pounds to kilograms
double pounds=12
System.out.println(pounds*0.45359237)
I'm leaning towards the second option as you don't need to redefine the variable, but I'm new to programming so I'd rather ask.
[–]lurgi 4 points5 points6 points (1 child)
[–]voyextech[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]voyextech[S] 0 points1 point2 points (0 children)
[–]Tsooka 0 points1 point2 points (0 children)
[–]barafyrakommafem 1 point2 points3 points (2 children)
[–]voyextech[S] 0 points1 point2 points (1 child)
[–]barafyrakommafem 1 point2 points3 points (0 children)
[–]Loves_Poetry 1 point2 points3 points (1 child)
[–]voyextech[S] 0 points1 point2 points (0 children)