Ejemplo2

1,946 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,946
On SlideShare
0
From Embeds
0
Number of Embeds
1,684
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Ejemplo2

  1. 1. package ejemploclases;public class Hexadecimal {public char ahexa(String bin) {char salida= ;int valor= Integer.parseInt(bin);switch(valor){case 0: salida=0;break;case 1: salida=1;break;case 10: salida=2;break;case 11: salida=3;break;case 100: salida=4;break;case 101: salida=5;break;case 110: salida=6;break;case 111: salida=7;break;case 1000: salida=8;break;case 1001: salida=9;break;case 1010: salida=A;break;case 1011: salida=B;break;case 1100: salida=C;break;case 1101: salida=D;break;case 1110: salida=E;break;case 1111: salida=F;break;}return salida;}}

×