The police do not allow him to go out of the city without ____.
A.permit
B.permission
C.admit
D.admission
第1题:
A.55
B.56
C.65
D.66
第2题:
publicclassYikes{publicstaticvoidgo(Longn){System.out.println(”Long);}publicstaticvoidgo(Shortn){System.out.println(”Short);}publicstaticvoidgo(intn){System.out.println(”int);}publicstaticvoidmain(String[]args){shorty=6;longz=7;go(y);go(z);}}Whatistheresult?()
A.intLong
B.ShortLong
C.Compilationfails.
D.Anexceptionisthrownatruntime.
第3题:
阅读以下说明和java代码,将应填入(n)处的字句写在对应栏内。
[说明]
本程序使用类来管理员工的通讯地址信息。已知程序的输出为:
输出记录:5
姓名:王丽华
街道地址:中华路15号
市:襄樊市
省:湖北省
邮政编码:430070
[Java代码]
public class Employee{
protected String (1);
protected String street;
protected String city;
protected String prov;
protected String post;
protected int no;
public Empbyee(){}
public Employee(String name,String street,String city,String prov,String post, (2) ){
this.name=name;
this.street=street;
this.city=city;
this.prov=prov;
this.post=post;
this.no=no;
}
public static void main(String[]args){
Employee emp=new Employee(“王华”,“中华路15号”,“武汉市”,“湖北省”,“430070”,1);
emp.changeName(“王丽华”);
(3) (“襄樊市”);
emp.changeNo(5);
(4);
}
void changeName(String name){this.name=name;}
void changeStreet(String street){this.street=street;}
void changeCity(String city){this.city=city;}
void changeProv(String prov){this.prov=prov;}
void changeNo(int no){(5);}
void display(){
System.out.println(“输出记录:”+this.no);
System.out.Println(“姓名:”+this.name);
System.out.println(“街道地址:”+this.street);
System.out.println(“市:”+this.city);
System.out.println(“省:”+this.prov);
System.out.println(“邮政编码:”+this.post);
}
}
第4题:
publicclassWow{publicstaticvoidgo(shortn){System.out.println(”short”);}publicstaticvoidgo(Shortn){System.out.println(”SHORT”);}publicstaticvoidgo(Longn){System.out.println(”LONG”);}publicstaticvoidmain(String[]args){Shorty=6;intz=7;go(y);go(z);}}Whatistheresult?()
A.shortLONG
B.SHORTLONG
C.Compilationfails.
D.Anexceptionisthrownatruntime.
第5题:
1.publicclassGoTest{
2.publicstaticvoidmain(String[]args){
3.Sentea=newSente();a.go();
4.Gobanb=newGoban();b.go();
5.Stonec=newStone();c.go();
6.}
7.}
8.
9.classSenteimplementsGo{
10.publicvoidgo(){System.out.println(”goinSente.”);}
11.}
12.
13.classGobanextendsSente{
14.publicvoidgo(){System.out.println(”goinGoban”);}
15.}
16.
17.classStoneextendsGobanimplementsGo{}
18.
19.interfaceGo{publicvoidgo();}
Whatistheresult?()
第6题:
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
fstream inout;
inout.open("city.txt",ios::out);
inout<<"Dallas"<<" "<<"tonghua"<<" "<<"长春"<<" " ;
inout.close();
inout.open("city.txt",ios::app | ios::out);
inout<<"罗马"<<" "<<"巴黎"<<" ";
inout.close();
char city[20];
inout.open("city.txt",ios::in);
while(!inout.eof())
{inout>>city;
cout<<city<<" ";
}
inout.close();
system("PAUSE");
return 0;
}
定义一个字符型数组city[20],将从文本文件“city.txt”所读取的数据,暂时存在city[20]中,然后通过输出函数cout将数据输出。