Binary Conversion in Java
First: Please format your code more consistently.

The indention of the whileloop is very unusual. Better (and more common):

public static String getBinary(int given) {
    char binNumbers[] = {'0','1'}; 
    String str = "";
    int rem;
    while (given &gt; 0) {
        rem = given % 2;
        str = binNumbers[rem] + str;
        given /= 2;
    }
    return str;
}


Next: Please use the default cases for identifiers. Classes should start upper case (Convert instead of convert).

Also use StringBuilder instead of String-concatenation:

public static String getBinary(int given) {
    char binNumbers[] = {'0','1'}; 
    StringBuilder sb = new StringBuilder();
    int rem;
    while (given &gt; 0) {
        rem = given % 2;
        sb.append(binNumbers[rem]);
        given /= 2;
    }
    return sb.toString();
}


Ths will be a large performace gain. Your code basically translates to:

public static String getBinary(int given) {
    char binNumbers[] = {'0','1'}; 
    String str = "";
    int rem;
    while (given &gt; 0) {
        rem = given % 2;
        //str = binNumbers[rem] + str;
        // Code generated by compiler for the above line of code
        StringBuffer sb = new StringBuffer();
        sb.append(binNumbers[rem]);
        sb.append(str);
        str = sb.toString();
        // End of generated code
        given /= 2;
    }
    return str;
}


As you can see the code generated many objects which have to be cleaned up afterwards by the Garbage Collector.

Hint:

You can use Integer.toString(given, 2) instead of your Convert.getBinary(given) for the same result.