in string how will write the return statement..........?

in string how will write the return statement..........?

import java.util.Scanner;
class BinaryConversion12{
 static int  j=1;
 static int l=1;
 public static void main(String args[]){
int i=Integer.parseInt(args[0]);
if(i>=256){
    System.out.println("please enter decimal no should be lessthan 256");
}
else{
    binary(i);
}
}
public static String binary(int i){
    if(i!=0)
    {
        int temp=0;
        temp=i%2;
        i=i/2;
        j++;
        binary(i);
        if(j==8)
            System.out.println(temp);
        else{
            l++;
            for(int k=j; k<=8; k++)
                if(l==2){
                System.out.print("0");
            }
            System.out.print(temp);
        }
    }
}
}
View Answers

Ads









Related Tutorials/Questions & Answers:
in string how will write the return statement..........?
How to return a string from a JTextField
Advertisements
how to write to file from string in Java
how to write a function to print for finding the longest palindrome in the given string
Write String in Word document
Java Write To File From String
How to Append String In Java?
How to write a loop and a while loop
How to write Java Program
How to write in File in Java
How to Write to file in Java?
How to write in File in Java
how to write code for this output?
How to write image in Jmagick
How to Convert String to Date?
how to write this program
How to write text on image
How to write to file using FileWriter
How to split string in Java?
Write a function that reads a string of digits, possibly preceded by + or -, and converts this string to the integer value it represents.
How to write calculator in J2ME program?
how to write servlet program in eclipse?
how to write store procedure in sql
How to trim string till indexof the string
How to convert into to String in Java?
How to Write to a File in Java
How to write to file using FileOutputStream
How to append String in Java?
How to Write To File BufferedWriter in Java
how to print String as pattern ?
How to display string or character

Ads