Overclock.net - An Overclocking Community - View Single Post - What is this? Not a string..

View Single Post
post #28 of (permalink) Old 11-01-2018, 11:35 PM
anti-clockwize
RIP OCN
 
Join Date: Dec 2014
Posts: 599
Rep: 25 (Unique: 19)
In java "Cheesebuger" = 1236 (added char values together)
C = 67
h = 104
e = 101
e = 101
s = 115
e = 101
b = 98
u = 117
r = 114
g = 103
e = 101
r = 114

Code:
        char[] ca = "Cheeseburger".toCharArray();

        int i = 0;
        for (char cc : ca) {
            i = i + (int) cc;
        }
        
        System.out.println(i);
anti-clockwize is offline