If someone can help,
I cannot pass this simple piece in javac:
import java.awt.*;
import java.awt.event.*;
public class Welcome{
public static void main(String args[]){
System.out.printf("%s\n%s\n", "Welcome to Java Programming", " and this is my first program.");
}//end; {main}.
}//end.
javac Welcome.java
----------
1. ERROR in Welcome.java (at line 6)
System.out.printf("%s\n%s\n", "Welcome to Java Programming", " and this is my first program.");
^^^^^^
The method printf(String, String, String) is undefined for the type PrintStream
However, I passed the compiler and java the following more complex piece smoothly, strange?
import java.awt.*;
import java.awt.event.*;
public class RedRect extends Frame{
public static void main(String[] args){new RedRect();}
RedRect(){
super("RedRect");
addWindowListener(
new WindowAdapter(){
public void windowClosing(WindowEvent e){System.exit(0);}
}
);
setSize(200, 100);
add("Center", new CvRedRect());
show();
}//end; {RedRect}.
}//end; {main}.
class CvRedRect extends Canvas{
public void paint(Graphics g){
Dimension d=getSize();
int maxX=d.width-1, maxY=d.height-1;
g.drawString("d.width="+d.width, 10, 30);
g.drawString("d.height="+d.height, 10, 60);
g.setColor(Color.red);
g.drawRect(0, 0, maxX, maxY);
}//end; {paint}.
}//end.
I am using YDL6.2 on PS3, thanks.