java 求救
见代码:
Java code:
import java.util.ArrayList;
import actor.Sheep;
public class BoundedGrid<E>
{
private Object[][] occupantArray; // the array storing the grid elements
public E get(Location loc)
{
if (!isValid(loc))
throw new IllegalArgumentException("Location " + loc
+ " is not valid");
return (E) occupantArray[loc.getX()][loc.getY()];
}
public ArrayList<Location> getEmptyLocations(Location l)
{
ArrayList<Location> theLocations = new ArrayList<Location>();
for (int r = -1; r < 2; r++)
{
for (int c = -1; c < 2; c++)
{
Location loc = new Location(l.getX() + r, l.getY() + c);
if (loc.getX() >=0 && loc.getY() >=0 && get(loc) == null)//get(loc) == null就可以
theLocations.add(loc);
}
}
return theLocations;
}
public ArrayList<Location> getSheepLocations(Location l)
{
ArrayList<Location> theLocations = new ArrayList<Location>();
// Look at all grid locations.
for (int r = -1; r < 2; r++)
{
for (int c = -1; c < 2; c++)
{
Location loc =
相关问答:
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
我现在想知道一个不常用的java关键字,
不是volatile,transate;
有点象LocalThread类,但又不是,是个完全小写的关键字,好象是local...啥的;
原来见过几回;今天怎么也找不到了;
Locale
Locator
引用
Locale
L ......
public class Student{
//字段的定义
private String _number; //学号
private String _name; //姓名
private   ......
我的Mysql 使用的时候 用dos建立的数据表 在dos中能显示出中文
但是在 其他的可视页面 和网页中都显示乱码 如何解决?
在mysql控制台:show variables like 'char%';贴结果出来看看。
mysql命令行模式下: ......
我希望在编辑文字后把发送键改到屏幕中间,具体说就是
在kb.class中的部分作出修改
部分代码:
V = new TextBox(ld.a(383), "", 190, 0);
X = new Comma ......