下列定义类的格式,和创建对象格式正确的是()
选项:
A:public class Cell{ private int row; int col; public void getCellInfo(){System.out.println(row+":"+col); }}
B: 创建对象的格式:Cell c=new Cell();
C: public class Cell(){ private int row; int col; public void getCellInfo(){System.out.println(row+":"+col); }}
D: 创建对象的格式:Cell c=new Cell;
发布时间:2024-05-21 20:40:27