Java代码查错1.abstract class Name {private String name;public abstract boolean isStupidName(String name) {}}大侠们,这有何错误?

Java代码查错

1.

abstract class Name {

private String name;

public abstract boolean isStupidName(String name) {}

}

大侠们,这有何错误?


相关考题:

有以下程序: #include 〈iostream〉 #include 〈string〉 using namespace std; class visited { private: int number; char *name; public: static int glob; void set mes(char *a); }; void visited::set mes(char *a) { name=new char[strlen(A) +1]; strcpy(name,A) ; number=++glob; } int visited::glob-O; int main() { visited person[10]; int i; char str[8]; for(i=0;i5;i++) { cinstr; person[i] .set mes(str); } coutA.5B.4C.3D.2

在编译Java程序时,用于指定生成.class文件位置的选项是()。A.#NAME?B.#NAME?C.#NAME?D.#NAME?

阅读以下说明和C++代码,填补代码中的空缺,将解答填入答题纸的对应栏内。[说明]在股票交易中,股票代理根据客户发出的股票操作指示进行股票的买卖操作。其类图如下图所示,相应的C++代码附后。类图[C++代码] #include<iostream> #include<string> #include<vector> using namespacestd; class Stock { private: string name; int quantity; public: Stock(stringname,int quantity) {this->name=name;this->quantity =quantity;} void buy() {cout<<"[买进]股票名称:"<<name<<",数量:"<<quantity<< endl;} void sell() {cout<<"[卖出]股票名称:"<<name<<",数量:"<<quantity <<endl;} }; clasS order{ public: virtual voidexecute()=0; }; classBuyStock:______ { private: Stock* stock; public: BuyStock(Stock*stock){______ =stock; } void execute(){ stock一>buy(); } }; //类SellStock的实现与BuyStock类似,此处略 class Broker{ private: vector<Order*> orderList; public: voidtakeOrder(______ order)( orderLiSt.push back(order);} void placeorders() { for(int i=0;i<orderList.Size(); i++){______ ->execute();} 0rderLiSt.clear(); } }; classStockCommand{ public: VOid main(){ Stock* aStock=newStock("股票A",10); Stock*bStock=newStock("股票B",20); Order*buyStockOrder=new BuyStock(aStock); Order*sellStockOrder=new SellStock(bStock); Broker* broker=newBroker(); broker->takeOrder(buyStockorder); broker->takeOrder(sellStockOrder); broker-> ______ (); } }; int main(){ StockCommand*stockCommand=new StockCommand(); StockCommand->main(); deleteStoCkCommand; }

阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。【Java代码】interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}

10、通过下面的代码片段来回答问题。 _________ User { var uuid:UUID var name:String init(uuid: UUID, name:String) { self.uuid = uuid self.name = name } } 下划线处可以填写哪些关键词?A.protocolB.structC.enumD.class

在接口中定义的方法具有public, abstract的特点(Java8以前)。

在Java代码中,通过()方式可以访问到配置文件中定义的颜色信息。A.R.color_name_idB.color_nameC.R.color.color_name_idD.R.string.color_name_id

42、在接口中定义的方法具有public, abstract的特点(Java8以前)。

25、在接口中定义的方法具有public, abstract的特点(Java8以前)。

在接口中定义的方法具有public, abstract的特点(Java8以前)