Driver program to test above function
public static void main ( String [ ] args ) { int R = 0 , G = 0 , B = 0 ; System . out . print ( convertRGBtoHex ( R , G , B ) + "NEW_LINE"); R = 255 ; G = 255 ; B = 255 ; System . out . print ( convertRGBtoHex ( R , G , B ) + "NEW_LINE"); R = 25 ; G = 56 ; B = 123 ; System . out . print ( convertRGBtoHex ( R , G , B ) + "NEW_LINE"); R = 2 ; G = 3 ; B = 4 ; System . out . print ( convertRGBtoHex ( R , G , B ) + "NEW_LINE"); R = 255 ; G = 255 ; B = 256 ; System . out . print ( convertRGBtoHex ( R , G , B ) + "NEW_LINE"); } }