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









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 write a loop and a while loop
How to write Java Program
How to write in File in Java
how to write in xml? - XML
How to Write to file in Java?
How to Append String In Java?
How to write in File 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 code for this output?
How to write image in Jmagick
how to write this program
How to write text on image
How to Convert String to Date?
How to write to file using FileWriter
How to write javascripts - JSP-Servlet
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 split string in Java?
How to write javascripts - JSP-Servlet
Return keyword
How to convert into to String in Java?
How to return multiple values from a method - Java Beginners
How to return multiple values from a method - Java Beginners
How to write to file using FileOutputStream
How to return dictionary keys as a list in Python
How to return dictionary keys as a list in Python
how to write java data - XML
How to Write To File BufferedWriter in Java
how to write to file at the end of the line
how to write file from FileInputStream
How to write file by line in Java
String
How to write a rsa algorithm using thread
How to write method for UITableView didSelectRowAtIndexPath?
How to write first example in Ajax?
How to append String in Java?
how to write append file in Java
write a java program for inserting a substring in to the given main string from a given position
write a program to create an arraylist with string(add,remove) operation.and value should be enter through keyboard.
write a program to create an vector with string(add,remove) operation.and value should be enter through keyboard.
write a program to create an arraylist with string(add,remove) operation.and value should be enter through keyboard.
How to write into CSV file in Java

Ads