small help about execution
Posted: Wed Aug 18, 2010 7:29 pm
I found this question in one of my studding kit..I wanna find the out put of this...I tried with my favorite JAVA editor..It contains errors..
this is the small code
when I compile this.There are no errors...
Then I ran this program with the hope of getting the out put for my question.But Then I got errors or some kind of statements about some errors
This is it...
can you tell me what is wrong????
this is the small code
Code: Select all
class EditEx6{
public static void main(String[] args){
int a=5,b=4,c=7;
System.out.printf("%3d%1$d%2$d",a,b,c);
}
}
Code: Select all
>javac EditEx6.java
>Exit code: 0
This is it...
Code: Select all
>javac EditEx6.java
>Exit code: 0
>java -cp . EditEx6
Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '$'
at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.io.PrintStream.format(Unknown Source)
at java.io.PrintStream.printf(Unknown Source)
at EditEx6.main(EditEx6.java:4)
>Exit code: 1