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

Answer by gabuzo for which one is faster 5+5+5+5+5 or 5*5?

$
0
0

In your case is does not change anything. Let's compile:

public class Toto {    public static void main(String[] args) {        int a = 5 + 5 + 5 + 5 + 5;        int b = 5 * 5;    }}

and check the decompilation result:

public class Toto{    public static void main(String args[])    {        byte byte0 = 25;        byte byte1 = 25;    }}

The compiler did inline everything.


Viewing all articles
Browse latest Browse all 9

Trending Articles



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