Wieso rechnet mein Code (JAVA) die Potenzen nicht (siehe Bild)?

Ohne die Methode .pow() der klasse Math werden die Potenzen nicht gerechnet, aber wieso? (Programm zum Hexadezimalzahlen in Dezimalz. umzurechnen)

Hier noch mein Code:

package Uebung07;

import javax.swing.JOptionPane;

public class Hexumrechner {

    public static void main(String[] args) {

String eingabe;
int summe = 0;
int potenz = 0;

eingabe = (JOptionPane.showInputDialog("Hexadezimalzahl in Dezimal und Binär umwandeln:"));

int l = eingabe.length()-1;

while(l >= 0) {

switch(eingabe.charAt(l)) {
case'A': summe += 10*Math.pow(16,potenz);
++potenz;
--l;
break;
case'B': summe += 11*(16^(potenz));
++potenz;
--l;
break;
case'C': summe += 12*(16^(potenz));
++potenz;
--l;
break;
case'D': summe += 13*(16^(potenz));
++potenz;
--l;
break;
case'E': summe += 14*(16^(potenz));
++potenz;
--l;
break;
case'F': summe += 15*(16^(potenz));
++potenz;
--l;
break;
case'1': summe += 1*(16^(potenz));
++potenz;
--l;
break;
case'2': summe += 2*(16^(potenz));
++potenz;
--l;
break;
case'3': summe += 3*(16^(potenz));
++potenz;
--l;
break;
case'4': summe += 4*(16^(potenz));
++potenz;
--l;
break;
case'5': summe += 5*(16^(potenz));
++potenz;
--l;
break;
case'6': summe += 6*(16^(potenz));
++potenz;
--l;
break;
case'7': summe += 7*(16^(potenz));
++potenz;
--l;
break;
case'8': summe += 8*(16^(potenz));
++potenz;
--l;
break;
case'9': summe += 9*(16^(potenz));
++potenz;
--l;
break;

    } } JOptionPane.showMessageDialog(null,summe);    }   }

Bild zum Beitrag
Mathematik, programmieren, Java
Weitere Inhalte können nur Nutzer sehen, die bei uns eingeloggt sind.