Java tutorial
//package com.java2s; public class Main { public static String interceptionString(int version) { String st = Integer.toHexString(version).toString(); int a = Integer.valueOf(st.substring(0, 1)); int b = Integer.valueOf(st.substring(1, 3)); int c = Integer.valueOf(st.substring(3, 5)); st = "v" + a + "." + b + "." + c; return st; } }