i wanna user to input a binary int,
and print its decimal equivalent.
here r my code:
import java.util.Scanner;
import java.text.DecimalFormat;
public class NumberFormat
{
public static void main(String args[])
{
Scanner side=new Scanner(System.in);
System.out.print("please enter a binary number:");
int i=side.nextInt();
System.out.println("Binary: " + i + " = " + Integer.toDecimal);
}
}
it shows cannot find the symbol variable toDecimal
pls help me modify it!! thx

New Topic/Question
Reply




MultiQuote




|