题目内容

阅读以下说明和Java代码,将应填入(n)处。
[说明]
在一公文处理系统中,开发者定义了一个公文类OfficeDoc,其中定义了公文具有的属性和处理公文的相应方法。当公文的内容或状态发生变化时,关注此OfficeDoc类对象的相应的DocExplorer对象都要更新其自身的状态。一个OfficeDoc对象能够关联一组 DocExplorer对象。当OfficeDoc对象的内容或状态发生变化时,所有与之相关联的 DocExplorer对象都将得到通知,这种应用被称为观察者模式。以下代码采用Java语言实现,能够正确编译通过。
[Java代码]
//Subject.java 文件
public interface Subject {
public void attach(Observer DocExplorer);
public void detach(Observer DocExplorer);
void notifyObservers();
}
//Observer.java 文件
public interface Observer{
void update((1) );
}
//OfficeDoc.java 文件
import java.util.*;
public class OfficeDoc implements Subject(//OfficeDoc 类实现 Subject 接口
private Vector bserverVeetor=new java.util.Vector();
//存储与OfficeDoc相关联的DocExplorer 对象
public void attach(Observer observer){
//将某 DocExplorer 对象与OfficeDoc 相关联
ObserverVector.addElement(observer);
}
public void detach(Observer observer){
//解除某DocExplorer 对象与OfficeDoc的关联关系
ObserverVector.removeElement(observer);
}
public void notifyObservers(){
//当OfficeDoc对象状态已发生变化时,通知所有的DocExplorer对象
Enumeration enumeration=(2);
while (enumeration.hasMoreElements()){
((Observer)enumeration.nextElement()).(3);
}
}
public Enumeration Observers(){
return ObserverVector.elements();
}
//其他公文类的属性和方法省略
}
//DoeExplorer.java 文件
public class DocExplorer implements (4) {
public void update((5) ){
//更新DocExplorer自身的状态,代码省略
}
}

查看答案
更多问题

Which person mentions
enjoying their pastime more than the job they used to do?
enjoying being in charge of their own life? 【S1】______
being surprised by suddenly losing their previous job? 【S2】______
not having other people depending on them financially? 【S3】______
missing working with other people? 【S4】______
undergoing training in order to take up their new job? 【S5】______
a contact being useful in promoting their new business? 【S6】______
not being interested in possible promotion in their old job? 【S7】______
disliking the amount of time they used to have to work? 【S8】______
surprising someone else by the decision they made? 【S9】______
a prediction that hasn't come true? 【S10】______
consulting other people about their businesses? 【S11】______
the similarities between their new job and their old one? 【S12】______
working to a strict timetable? 【S13】______
A NEW LIFE
A The Farmer
Matt Froggatt used to be an insurance agent in the City of London but now runs a sheep farm.
"After 14 years in business, I found that the City had gone from a place which was exciting to work into a grind-no one was having fun any more. But I hadn't planned to leave for another five or ten years when I was made redundant. It came out of the blue, but it made me take a careful look at my life. I didn't get a particularly good pay-off but it was enough to set up the farm with. My break came when I got to know the head chef of a local hotel with one of the top 20 hotel restaurants in the country. Through supplying them, my reputation spread and now I also supply meat through mail order. I'm glad I'm no longer stuck in the office but it's astonishing how little things have changed for me: the same 80- to 90- hour week and still selling a product."
B The Paniter
Ron Able white was a manager in advertising but now makes a living as an artist.
"My painting began as a hobby but I realised I was getting far more excitement out of it than out of working. The decision to take redundancy and to become an artist seemed logical. The career counsellor I talked to was very helpful. I think I was the first person who had ever told him, '1 don't want to go back to where I've been.' He was astonished because the majority of people in their mid-forties need to get back to work immediately -they need the money. But we had married young and our children didn't need our support. It was a leap into the unknown. We went to the north of England, where we didn't know a soul. It meant leaving all our friends, but we've been lucky in that our friendships have survived the distance plenty of them come up and visit us now."
C The Hatmaker
After working for five years as a company lawyer, Katherine Goodison set up her own business in her London flat, making hats for private clients.
"My job as a lawyer was fun. It was stimulating and I earned a lot of money, but the hours were terrible. I realised I didn't wan

附子汤和当归芍药散均可治疗妊娠腹痛,两者在病机、症状、治法上有何区别?

This book covers almost every aspect of the field concerned and also reviews the best practice in this field.

网页留言效果如下图所示,网页文档如下,请参照表格给出的说明在下划线处填写正确的答案到答题纸对应的栏内。
[上图网页中的元素说明]
[HTML文本]
<!DOCrYPE HTML PUBLIC“-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>您的意见就是对我们工作莫大的支持!</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</head>
<body>
(1)
<tablewidth="400"border="0"celipadding="0"cellspacing="2">
<tr style="vertical-align:top">
<tdwidth="24%"align="center"valign="middle"class="TitleColor">
<label for="name",意见主题</label>
<label for="username">,</label>
<label for="questions"></label>
<br>
<br> </td>
<td width="76%" class="TitleColor">
<label for="browser"></label>
<inputtype="text"id="username"name="textTitle"size="40"></td>
</tr>
<tr style="vertical-align:top">
<td align= "center"valign="middle"class="TitleColor",<label for="label",电子邮件</label></td>
<td Class="TitleColor">
(2)
</td>
</tr>
<tr style="vertical-align:top">
<tdalign="center"valign="middle"class="TitleColor"><label for="label")您的姓名<br>
</label></td>
<td class="TitleColor"><input type="text" id="name" name="textName" size=<"40"></td>
</tr>
<tr style="vertical-align:top">
<tdalign="center"valign="middle"class="TitleColor"><label for="label")意见建议</label></td>
<td Class=”TitleColor”>
(3)
</td>
</tr>
<tr style="vertical-align:top'>
<tdheight="9"colspan="2">
(4)
</td>
</tr>
<tr style="vertical-align:top">
<tdheight="29"colspan="2"> <div align="center">
<inputtype="submit"name="Submit"value="提交">
    
<inputtype="reset"name="Submit2"value="重置">
</div></td>
</tr>
<tr style="vertical-align:top">
<tdheight="29"colspan="2"><div align="center">
(5)
</div></td>
</tr>
</table>
</form>
</body>
</html>
(1)

答案查题题库