对于下列代码,下列哪个叙述是错误的?interface Com {int MAX = 100;void stop();abstract void start();}
A. void stop();会导致编译出错。
B. 编译器认为 void stop();就是public abstract void stop();
C. 编译器认为 abstract void start();就是public abstract void start();
D. 编译器认为 int MAX = 100;就是 public static final int MAX = 100;
查看答案
下列【1】、【2】、【3】、【4】注释标注的哪行代码有错误?public interface Com {abstract void cry();//【1】public int x = 0;//【2】}abstract class Animal implements Com {public abstract void cry();}class E {public static void main(String args[]){Animal dog = null ; // 【3】dog = new Animal(); // 【4】}}
A. 【1】
B. 【2】
C. 【3】
D. 【4】
给出下列【代码】注释标注的代码的输出结果。interface Com {public abstract char cry();}class Dog implements Com{public char cry(){return 'D';}}class Cat implements Com{public char cry(){return 'C';}}class People {Com com;char seeCry(Com com){return com.cry();}}public class E {public static void main(String args[]){People p = new People ();char c1 = p.seeCry(new Dog());char c2 = p.seeCry(new Cat());System.out.printf("%c:%c",c1,c2);//【代码】}}
interfaceCom{intadd(inta,intb);publicstaticintget(intn){returnn;}publicdefaultintsee(intn){returnn;}publicdefaultintlook(intn){returnn;}}classAimplementsCom{publicintadd(inta,intb){returna+b;}publicintsee(intn){returnn+1;}}publicclassMain{publicstaticvoidmain(Stringargs[]){Aa=newA();intm=a.add(12,6);intn=Com.get(12);intt=a.see(6);intq=a.look(6);System.out.printf("%d:%d:%d:%d",m,n,t,q);//【代码】}}
My roommate is _____________(drive) me crazy. She is a binge watcher.追剧者 She _________(stay up)熬放 very late ____________(watch)Game of Throne lately. She likes to ___________(keep) the light on but I find it hard to fall asleep with light on. Sometimes I woke up by her giggling咯咯. What should I do? I have no idea how to talk to her. Do you have any ___________(suggest)?