我上周开始学习 Java,所以请耐心等待,因为我刚刚掌握了窍门。我正在尝试创建一个扩展 Java Robot 类的类。
我在这一行得到一个“预期标识符”:
public ChanseyRobot(bot)
机器人类:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.awt.MouseInfo;
public class ChanseyRobot extends Robot
{
private Robot bot;
public ChanseyRobot(bot)
{
try
{
this.bot = new Robot();
}
catch (AWTException e)
{
throw new RuntimeException(e);
}
}
}
主类:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.awt.MouseInfo;
public class Main
{
public static void main(String args[])
{
ChanseyRobot robot = new ChanseyRobot(robot);
}
}