A
ankur
Hi all,
I am a java newbie and I am using eclipse to write this simple code:
// Fig. 3.17: Dialog1.java
// Printing multiple lines in dialog box.
import javax.swing.JOptionPane; // import class JOptionPane
public class DialogBox
{
public static void main( String args[] )
{
String j = "abc";
//System.out.print(j);
// display a dialog with the message
String.format("This is a string %s", j);
System.out.printf("This is a simple string %s", j);
//JOptionPane.showMessageDialog( null, "Welcome\nto\nJava" );
} // end main
} // end class Dialog1
I am getting this error message for format and printf statements:
The method format(String, Object[]) in the type String is not
applicable for the arguments (String, String)
The method printf(String, Object[]) in the type PrintStream is not
applicable for the arguments (String, String)
I am using jre : jre1.6.0_02
Can anyone help !!
Thanks,
Ankur
I am a java newbie and I am using eclipse to write this simple code:
// Fig. 3.17: Dialog1.java
// Printing multiple lines in dialog box.
import javax.swing.JOptionPane; // import class JOptionPane
public class DialogBox
{
public static void main( String args[] )
{
String j = "abc";
//System.out.print(j);
// display a dialog with the message
String.format("This is a string %s", j);
System.out.printf("This is a simple string %s", j);
//JOptionPane.showMessageDialog( null, "Welcome\nto\nJava" );
} // end main
} // end class Dialog1
I am getting this error message for format and printf statements:
The method format(String, Object[]) in the type String is not
applicable for the arguments (String, String)
The method printf(String, Object[]) in the type PrintStream is not
applicable for the arguments (String, String)
I am using jre : jre1.6.0_02
Can anyone help !!
Thanks,
Ankur