Quantcast
Channel: which one is faster 5+5+5+5+5 or 5*5? - Stack Overflow
Viewing all articles
Browse latest Browse all 9

which one is faster 5+5+5+5+5 or 5*5?

$
0
0

I don't know how to ask but just want to ask. help me to tag it please. Anyway, my friend asked me a question that which one is faster in Java

int a = 5 + 5 + 5 + 5 + 5

or

int b = 5 * 5 ?

Is it language dependent ? I mean, a is faster than b in java but not in C

my answer is a is faster than b because of comparison of addition/multiplication in computer organization


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>