我对此很陌生,我不太了解这里发生了什么。我试图使变量名climbBuilding
像调用时放在花括号内一样。但是,每次尝试执行此操作时,都会告诉我找不到字母“ s”的符号。这是完整的代码
import becker.robots.*;
public class SpiderManA
{
public static void main(String[]args)
{
City nyc = new City();
Robot spiderBot = new Robot(nyc,5,0,Direction.EAST);
// this is the first building
Wall aWall = new Wall(nyc,5,1,Direction.WEST);
Wall bWall = new Wall(nyc,4,1,Direction.WEST);
Wall cWall = new Wall(nyc,3,1,Direction.WEST);
Wall dWall = new Wall(nyc,2,1,Direction.WEST);
Wall eWall = new Wall(nyc,1,1,Direction.WEST);
Wall fWall = new Wall(nyc,1,1,Direction.NORTH);
Wall gWall = new Wall(nyc,5,1,Direction.EAST);
Wall hWall = new Wall(nyc,4,1,Direction.EAST);
Wall iWall = new Wall(nyc,3,1,Direction.EAST);
Wall jWall = new Wall(nyc,2,1,Direction.EAST);
Wall kWall = new Wall(nyc,1,1,Direction.EAST);
//this is the second building
Wall lWall = new Wall(nyc,5,3,Direction.WEST);
Wall mWall = new Wall(nyc,4,3,Direction.WEST);
Wall nWall = new Wall(nyc,3,3,Direction.WEST);
Wall oWall = new Wall(nyc,2,3,Direction.WEST);
Wall pWall = new Wall(nyc,1,3,Direction.WEST);
Wall qWall = new Wall(nyc,1,3,Direction.NORTH);
Wall rWall = new Wall(nyc,5,3,Direction.EAST);
Wall sWall = new Wall(nyc,4,3,Direction.EAST);
Wall tWall = new Wall(nyc,3,3,Direction.EAST);
Wall uWall = new Wall(nyc,2,3,Direction.EAST);
Wall vWall = new Wall(nyc,1,3,Direction.EAST);
//this is the third building
Wall wWall = new Wall(nyc,5,5,Direction.WEST);
Wall xWall = new Wall(nyc,4,5,Direction.WEST);
Wall yWall = new Wall(nyc,3,5,Direction.WEST);
Wall zWall = new Wall(nyc,2,5,Direction.WEST);
Wall a1Wall = new Wall(nyc,1,5,Direction.WEST);
Wall b1Wall = new Wall(nyc,1,5,Direction.NORTH);
Wall c1Wall = new Wall(nyc,5,5,Direction.EAST);
Wall d1Wall = new Wall(nyc,4,5,Direction.EAST);
Wall e1Wall = new Wall(nyc,3,5,Direction.EAST);
Wall f1Wall = new Wall(nyc,2,5,Direction.EAST);
Wall g1Wall = new Wall(nyc,1,5,Direction.EAST);
spiderBot.climbBuilding();
}
// now we are going to make a climbBuilding method
public void climbBuilding()
{ spiderbot.move();
spiderBot.move();
spiderBot.move();
spiderbot.move();
}
}
这是它给出的错误。
D:\Chapter 3\SpiderManA.java:48: error: cannot find symbol
spiderBot.climbBuilding();
^
symbol: method climbBuilding()
location: variable spiderBot of type Robot
D:\Chapter 3\SpiderManA.java:54: error: cannot find symbol
{ spiderbot.move();
^
symbol: variable spiderbot
location: class SpiderManA
D:\Chapter 3\SpiderManA.java:55: error: cannot find symbol
spiderBot.move();
^
symbol: variable spiderBot
location: class SpiderManA
D:\Chapter 3\SpiderManA.java:56: error: cannot find symbol
spiderBot.move();
^
symbol: variable spiderBot
location: class SpiderManA
D:\Chapter 3\SpiderManA.java:57: error: cannot find symbol
spiderbot.move();
^
symbol: variable spiderbot
location: class SpiderManA
5 errors