QUESTION NO:2 publicclassTest2 { staticbooleanfoo(charc) {
System.out.print(c); returntrue;
} publicstaticvoidmain(String[] argv) { inti = 0;
//for(65;88&&(i<2);67) for(foo('A');foo('B') && (i < 2);foo('C')) {
i++; foo('D');
}
}
}
/*
What is the result?
A. ABDCBDCB
B. ABCDABCD
C. Compilation fails.
D. An exception is thrown at runtime.
//输出结果是:ABDCBDCB
分析:FOR循环里面讲究的条件要为真,与你的判断式是什么没有关系
就像这里,虽然是打印的字母,但是却不是false,所以可以执行
第一次进行循环:
foo('A')打印字母A,(注:这里不是false条件就默认为true条件)
foo('B')打印字母B,i=0,比较(i < 2),条件为true,进行循环体,foo('D')打印D
foo('C')打印字母C
第二次循环:
foo('B')打印B,i=1,比较(i < 2)为true,进行循环体,foo('D')打印D
foo('C')打印字母C
第三次循环:
foo('B')打印字母B,i=2,比较(i < 2)为false,退出循环,得结果
*/
QUESTION NO: 3
1. class A {
2. protected int method1(int a, int b) { return 0; }
3. }
Which two are valid in a class that extends class A? (Choose two)
A. public int method1(int a, int b) { return 0; }
B. private int method1(int a, int b) { return 0; }
C. private int method1(int a, long b) { return 0; }
D. public short method1(int a, int b) { return 0; }
E. static protected int method1(int a, int b) { return 0; } publicclassBextendsA{
/**
*@paramargs
*/
//can not reduce the visibility of the inherited method from A
//即不能够使从类A中继续来的方法的可见性降低
//private int method1(int a, int b) { return 0; }
//This static method cannot hide the instance method from A
//静态方法不能够隐藏继承于A的实例
//static protected int method1(int a, int b) { return 0; }
//返回类型与A中的该方法不一致
//public short method1(int a, int b) { return 0; }
1. public class Outer{
2. public void someOuterMethod() {
3. // Line 3
4. }
5. public class Inner{}
6. public static void main( String[]argv ) {
7. Outer o = new Outer();
8. // Line 8
9. }
10. }
Which instantiates an instance of Inner?
A. new Inner(); // At line 3
B. new Inner(); // At line 8
C. new o.Inner(); // At line 8
D. new Outer.Inner(); // At line 8//new Outer().new Inner()
答案如下: publicclassOuter { publicvoidsomeOuterMethod() {
// Line 3 newInner();//放在这里不出错
} publicclassInner {
}
Which method is used by a servlet to place its session ID in a URL that is written to the servlet’s response output stream?
(译:那个方法是servlet用于将其session ID入在一个URL中,该URL写入servlet的响应输出流)
A. The encodeURL method of the HttpServletRequest interface.
B. The encodeURL method of the HttpServletResponse interface.
C. The rewriteURL method of the HttpServletRequest interface.
D. The rewriteURL method of the HttpServletResponse interface.
QUESTION NO: 6
Which two are equivalent? (Choose two)
A. <%= YoshiBean.size%>
B. <%= YoshiBean.getSize()%>
C. <%= YoshiBean.getProperty("size")%>
D. <jsp:getProperty id="YoshiBean" param="size"/>
E. <jsp:getProperty name="YoshiBean" param="size"/>
F. <jsp:getProperty id="YoshiBean" property="size"/>
G. <jsp:getProperty name="YoshiBean" property="size"/>
QUESTION NO: 7
Which of the following statements regarding the lifecycle of a session bean are correct?
1.java.lang.IllegalStateException is thrown if SessionContext.getEJBObject() is invoked when a stateful session bean instance is passivated.
2.SessionContext.getRollbackOnly() does not throw an exception when a session bean with bean-managed transaction demarcation is activated.
3.An exception is not thrown when SessionContext.getUserTransaction() is called in the afterBegin method of a bean with container-managed transactions.
4.JNDI access to java:comp/env is permitted in all the SessionSynchronization methods of a stateful session bean with container-managed transaction demarcation.
5.Accessing resource managers in the SessionSynchronization.afterBegin method of a stateful session bean with bean-managed transaction does not throw an exception.
2. XML包括哪些解释技术,区别是什么?
包括:DOM(Document Object Modal)文档对象模型,SAX(Simple API for XML)。DOM是一次性将整个文档读入内存操作,如果是文档比较小,读入内存,可以极大提高操作的速度,但如果文档比较大,那么这个就吃力了。所以此时SAX应用而生,它不是一次性的将整个文档读入内存,这对于处理大型文档就比较就力了
题目:
1、查询身份证号码为440401430103082的申请日期
Select g_cardapply.g_ applydate from g_cardapply, g_cardapplydetail where g_cardapplydetail.g_idcard=’’ and g_cardapply.g_applyno=g_cardapplydetail.g_applyno 2、查询同一个身份证号码有两条以上记录的身份证号码及记录个数
1、select a1.g_applydate from g_cardapply as a1 inner join g_cardapplydetail a2 on
a1.g_applyno=a2.g_applyno where a2.g_idcard="123" ;
2、select g_idcard,count(g_idcard) from g_cardapplydetail
group by g_idcard having count(g_idcard)>=2;
3、update g_cardapply set g_state=603 from g_cardapply as g_d inner join g_cardapplydetail as g_c on
g_d.g_applyno=g_c.g_applyno and g_idcard='123';更新第一个表的g_state
update g_cardapplydetail set g_state=603 where g_idcard='123';
6.Hibernate Synchronizer
Hibernate Synchronizer is a free Eclipse plugin code generation tool to be used with the Hibernate persistence framework. The plugin will automatically generate java code when your hibernate mapping files are modified. Objects are created with generated codein an abstract base class and a user-modifiable extension class so user code does not get deleted when the generation is performed.
http://www.binamics.com/hibernatesync/
https://sourceforge.net/project/showfiles.php?group_id=99370
HibernateSynchronizer-2.1.25-Eclipse3M6.zip?? 只支持到M7 7. SWT Designer 使GUI更cool,更in,更happy!
http://www.swt-designer.com/?? 14天 8. XML Editor & XSLT Debugger 编辑XML的插件
http://www.oxygenxml.com/ 8.1支持Eclipse 3.0 的XML插件
http://www.xmlbuddy.com/ 8.2XML Viewer Version: 1.1.7
http://tabaquismo.freehosting.net/ignacio/eclipse/xmlview/index.html
9.UML Tool for Eclipse http://www.visual-paradigm.com/download.php?shortName=sdeec 9.1 UML插件 Omondo的(支持eclipse 3.0 的studio 1.0 只试用20天) http://www.omondo.com/
useId :ylfly password:******* 9.2EclipseUML2? is Eclipse tools
http://www.eclipse.org/uml2/ 10.Eclipse加速插件KeepResident
http://suif.stanford.edu/pub/keepresident/
原理:利用两个 Windows API - SetProcessWorkingSetSize 与 VirtualLock (适用于 Windows 平台)。
切换时果然快很多。
官方建议最小值设定在 100 MB,最大值 250 MB 左右。 11.RMI Plugin for Eclipse 1.6.0 for Eclipse 3.0 http://www.genady.net/rmi 12其它插件
perl插件http://e-p-i-c.sf.net/updates
C#插件?http://www.improve-technologies.com/alpha/updates/site.xml
C插件???http://update.eclipse.org/tools/cdt/releases/new
Hex插件http://ehep.sourceforge.net/update 13.Eclipse插件使用links目录的用法: 假设把插件安装在d:/myplugin目录中,则myplugin的目录结构一定要是这样的:
d:/myplugin/eclipse/plugins/插件 及 d:/myplugin/eclipse/features/插件
例如安装EclipseME插件到d:/myplugin目录中,则目录结构
d:/myplugin/eclipse/plugins/eclipseme_0.4.5。
再假设eclipse安装在d:/eclipse目录中,则在eclipse目录中创建名称为links的目录,在links目
录中建立一个link文件,比如myplugin.link,该文件内容为path=d:/myplugin。
启动eclipse,插件即安装上了,如果想暂时不启动插件,只需把myplugin.link文件删除即可。
补充说明:
1. 插件可以分别安装在多个自定义的目录中。
2. 一个自定义目录可以安装多个插件。
3. link文件的文件名及扩展名可以取任意名称,比如myplugin.txt,goodplugin都可以。
4. link文件可以有多行path=插件目录,对应多个自定义插件目录,每一行的path参数都将生效。
5. 在links目录也可以有多个link文件,每个link文件中的path参数都将生效。
6. 插件目录可以使用相对路径,如果我们把myplugin目录创建在eclipse安装目录中,如上例中的
d:/eclipse目录中,则只需设置path=myplugin即可。 14.Eclipse tools
1).ALL SDK bundle (includes Source, Runtime and Docs for EMF, XSD, and SDO).
?
2).The Graphical Editing Framework (GEF) allows developers to take an existing application
model and quickly create a rich graphical editor.
3).UML2 is an EMF-based implementation of the UML 2.0 metamodel for the Eclipse platform.
http://www.eclipse.org/emf/
http://www.eclipse.org/gef/
http://www.eclipse.org/uml2/ 15.plug-in网址:
http://www.eclipse-plugins.info/eclipse/index.jsp
http://www.eclipse-workbench.com/jsp/
http://eclipse-plugins.2y.net/eclipse/index.jsp(非常非常著名的插件更新网站)
http://www.crionics.com/products/opensource/eclipse/eclipse.jsp(分类清楚)
http://www.eclipseplugincentral.com/ 16.调试JSP时,在tomcat里改/conf/server.xml