class ToHex1
{
public static void main(String[] args)
{
toHex2(60);
}
public static void toHex2(int num){
char arr[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char ar[]=new char[8];
int pos=ar.length;
while(num!=0){
int temp = num & 15;
ar[--pos]=arr[temp];
num = num>>>4;
}
for(int x= pos ;x<ar.length;x++){
System.out.print(ar[x]);
}
}
}
{
public static void main(String[] args)
{
toHex2(60);
}
public static void toHex2(int num){
char arr[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char ar[]=new char[8];
int pos=ar.length;
while(num!=0){
int temp = num & 15;
ar[--pos]=arr[temp];
num = num>>>4;
}
for(int x= pos ;x<ar.length;x++){
System.out.print(ar[x]);
}
}
}