当前位置: 技术问答>java相关
这道提为什么不选B?
来源: 互联网 发布时间:2015-10-27
本文导语: 22. Which are correct class declarations? Assume in each case text constitutes the entire contents of a file called Fred.java on a system with a case-significant system. A. public class Fred { public ...
22. Which are correct class declarations? Assume in each case text
constitutes the entire contents of a file called Fred.java on a system
with a case-significant system.
A. public class Fred {
public int x = 0;
public Fred (int x) {
this.x = x;
}
}
B. public class fred {
public int x = 0;
public fred (int x) {
this.x = x;
}
}
C. public class Fred extends MyBaseClass, MyOtherBaseClass {
public int x = 0;
public Fred (int xval) {
x = xval;
}
}
D. protected class Fred {
private int x = 0;
private Fred (int xval) {
x = xval;
}
}
E. import java.awt.*;
public class Fred extends Object {
int x;
private Fred (int xval) {
x = xval;
}
}
答案是AE.为什么不选B?
constitutes the entire contents of a file called Fred.java on a system
with a case-significant system.
A. public class Fred {
public int x = 0;
public Fred (int x) {
this.x = x;
}
}
B. public class fred {
public int x = 0;
public fred (int x) {
this.x = x;
}
}
C. public class Fred extends MyBaseClass, MyOtherBaseClass {
public int x = 0;
public Fred (int xval) {
x = xval;
}
}
D. protected class Fred {
private int x = 0;
private Fred (int xval) {
x = xval;
}
}
E. import java.awt.*;
public class Fred extends Object {
int x;
private Fred (int xval) {
x = xval;
}
}
答案是AE.为什么不选B?
|
B中fred的f小写了
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。