J2EE面试题集锦(附答案)
/*** 题目答案来源于网络,不能保证其正确或完整性,仅供参考**/ 一、基础问答 1.下面哪些类可以被继承? java.lang.Thread (T) java.lang.Number (T) java.lang.Double (F) java.lang.Math (F) java.lang.Void (F) java.lang.Class (F) java.lang.ClassLoader (T) 2.抽象类和接口的区别 (1)接口可以被多重implements,抽象类只能被单一extends (2)接口只有定义,抽象类可以有定义和实现 (3)接口的字段定义默认为:public static final, 抽象类字段默认是"friendly"(本包可见)
解析Class文件魔数和版本号[转]
众所周知,Java语言的可执行文件是class文件,俗称类文件。这个文件为了让不同平台的虚拟机都能够正确的解释,详细规定了其文件格式。下面就按照顺序进行介绍:1、 魔数(magic)为了方便虚拟机识别文件是否是class格式的文件,SUN公司规定每个class文件都必须以一个word(4个字节)来开始,这个数字就称为魔数。魔数是有4个字节的无符号数字构成的,而且规定魔数必须是0xCAFEBABE。2、 版本号(version)魔数后续的内容就是一个word的长度来表示生成的class文件的版本号,版本号分为主版本号和次版本号,其中前两个字节表示次版本号,后两个字节
How to move progress database to different OS
Migrating databases between server platforms is sometimes possible using a Progress database copy utility. However, changing database servers often requires a data dump & load from the original server to the new server. The following Progress Knowledgebase entry describes how to determine if the server types are compatible for a database copy process or if a data dump and load is required.INTRODUCTION:=============Customers often ask about PROGRESS database portability: under whatcircumstanc
[原创]PROGRESS .I 文件中定义变量要小心
PROGRESS程序中的.I 写程序时要注意 定义一个变量时最好用以下语句&if defined(shipnbr) = 0 &then&scoped-define shipnbr ""&endif因为假如你用 define var a as 很可能调用的.P 调用两次该.I时 ,由于PROGRESS的编译原理是把.I的内容直接放到.P后再编译,这时很明显编译前的.P的内容就是有两行define var a as ,编译就会出错提示重复定义了VAR A[@more@]
XML的简单读取与写入
已知有一个XML文件(bookstore.xml)如下:<?xml version="1.0" encoding="gb2312"?><bookstore><book genre="fantasy" ISBN="2-3631-4"><title>Oberon's Legacy</title><author>Corets, Eva</author><price>5.95</price></book></bookstore>1、往< bookstore >节点中插入一个< book >节点:XmlDocument xmlDoc=new XmlDocument();xmlDoc.Load("bookstore.xml");XmlNode root=xmlDoc.SelectSingleNode
SQL Server 字符串和时间相互转换
select convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120)) as VoucherTimefrom SSD_SellRecord group by convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120))因为要根据日期来group by,所以用convert(char(10),SSD_SellRecord.VoucherTime,120)截取日期部分。又因为我们希望的最终结果是时间类型,所以还得用convert(smalldatetime, convert(char(10),SSD_SellRecord.VoucherTime,120))进行转换。[@more@]
c#.net中参数修饰符ref,out ,params得区别
params 关键字可以指定在参数数目可变处采用参数的方法参数。 在方法声明中的 params 关键字之后不允许任何其他参数,并且在方法声明中只允许一个 params 关键字。 示例 // cs_params.cs using System; public class MyClass { public static void UseParams(params int[] list) { for ( int i = 0 ; i < list.Length ; i++ ) Console.WriteLine(list[i]); Console.WriteLine(); } public static void UseParams2(params object[] list) { for ( int i = 0 ; i < list.Length ; i++ ) Console.WriteLine(list[i]); Console.WriteLin
当XMLHTTP返回的XML数据流中没有数据时怎么样进行异常处理?
这是我写的一个login.asp文件。调用一个XML数据接口获取XML数据流。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Untitled Document</title> </head> helloworld<br> <% Set XMLHTTP=server.CreateObject("Microsoft.XMLHTTP") XMLHTTP.Open"Get", "ht
servlet接收xml数据流[java]
我是这么收的 BufferedReader reader1 = request.getReader(); InputSource is= new InputSource(reader1); if(is != null){ System.out.print(readXMLFile(is)); } else{ System.out.print("no data receive"); } private String readXMLFile(InputSource in) throws Exception { Vector student_Vector = new Vector(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = null; try { db = dbf.newDocumentBuilder(); } catch (ParserConfigurationException pce) { System.err.prin
XmlHttp异步获取网站数据的例子
net_lover [原作] <script>var oDiv var xh function getXML(){oDiv = document.all.moDiv.innerHTML = "正在装载栏目数据,请稍侯......."oDiv.style.display= ""xh = new ActiveXObject("Microsoft.XMLHTTP")xh.onreadystatechange = getReadyxh.open("GET",a.value,true)xh.send()}function getReady(){if(xh.readyState==4){if(xh.status==200){oDiv.innerHTML = "完成"}else{oDiv.innerHTML = "抱歉,装载数据失败。原因:" + xh.statusText}}}</script>&l
用XMLHTTP实现无刷新的与server通信
XMLHTTP XMLHTTP的用处很多,这里只说我们需要的,就是无刷新的与server通信,看这段代码: 代码:<script language="javascript"> xml = new ActiveXObject("Microsoft.XMLHTTP"); var post=" ";//构造要携带的数据 xml.open("POST","http://localhost:7001/TestWL/index.jsp",false);//使用POST方法打开一个到服务器的连接,以异步方式通信 xml.setrequestheader("content-length",post.length); xml.setrequestheader("content-type","application/x
cups-1.1.17 中打印参数-n 在部分打印机中不起作用
lp -d bc -n 3 /aaa但发现这命令对于HP LJ1200没问题可以打出3张文件但发现在BARCODE打印机上就会-n 参数不起作用了 INTERMAC 3400E.目前还在测试中!!!!!!!![@more@]
cups-1.1.17 中打印参数-n 的最大值问题
lp -d bc -n xxx是有限制的为100 ,假如你打101就错误了,所以只能让他分开两次完成.一次打100 ,一次打1[@more@]
How to Cim load multiple entries into 7.6.5.4 SO Container Maintenance or 16.11
诸如CIMLOAD 16.11时把multiple entries 设成Y然后进行CIMLOAD时要小心,把变量BATCHRUN设成Y,否则会出现 progress 错误26Error: Array subscript 0 is out of range. (26)[@more@]
add field security
When you want to add field security you add in the data dictionary two additional lines:In the FIELD VALIDATION: {gppswd.v &field = "cm_cr_terms"}In the FIELD VALIDATION MESSAGE:ERROR: USER DOES NOT HAVE ACCESS TO THIS FIELD. Please re-enter.You have now another challange. The customer credit terms already contains another validation:can-find(ct_mstr where ct_code = cm_cr_terms) or cm_cr_te = ""cm_cr_te is no TYPING ERROR. It is the shortest unique name for this field!!Yo
增加字段的通用代码验证功能
通常如1.4.1中某些字段,如pt_group会有提示:口令和通用代码有效性核对字段: pt_group其实这是要在通过修改数据表和从新编译相关程序来实现的.1.进入数据字典找到该表修改该字段,在Valexp:中增加{gpcodsec.v pt_group}, 当然pt_group必须已经在通用代码中的字段名称中存在.2.修改完后,从新编译gpsecxr.p.完成后,你可以通过在执行程序中选择该字段按"ctrl+f",得到相关的提示.[@more@]
ES3.0安装ORACLE出现Xlib: connection to
引用:[oracle@Zheng Disk1]$ Initializing Java Virtual Machine from /tmp/OraInstall2004-04-17_05-52-49PM/jre/bin/java. Please wait...Xlib: connection to ":0.0" refused by serverXlib: No protocol specifiedException in thread "main" java.lang.InternalError: Can't connect to X11 windowserver using ':0.0' as the value of the DISPLAY variable.at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)at
Install Oracle 9i on Redhat Linux AS4
前两天受同学之托,要在linux上面装oracle 9i,开始用的是redhat 9.0无奈没有metadata的帐号,关键的一个补丁包始终下不到,只能放弃安装。而后转战AS4,同样需要好几个补丁包,经过苦苦寻找,在互联网分享精神的保佑下,终于搜集到了几个必要的补丁包,开始安装。避免麻烦,系统选择完全安装。以后不需要的包可以再删嘛。1、去oracle的网站把三个镜像下载下来,然后解压。#zcat ship_9204_linux_disk1.cpio.gz | cpio -idmv#zcat ship_9204_linux_disk2.cpio.gz | cpio -idmv#zcat ship_9204_linux_disk3.cpio.gz | cpio -idmv2. 新建ora
[转贴]为什么有人不喜欢标准成本(陆炳辉)
许多人都认为成本核算是ERP中十分重要的部分,正在选型的公司也往往对成本功能非常关注。我也认为其十分重要,甚至认为应该把成本核算能否自动完成作为ERP实施是否成功的标志之一。ERP软件中一般都有多种成本核算方法可供选择,通常分为两大类:标准成本法和实际成本法。实际成本法中一般再分为移动加权平均法、先进先出法、后进先出法等等。说起来各种方法并无优劣之分,然而为什么顾问常常推荐采用标准成本法?为什么企业中(尤其是国有企业)却总有人不喜欢标准成本法?这就成了不得不解释清楚的问题了。先说说为什么顾问常常推荐采用标
yield 与 scrap
工序中与物料的产出率(YIELD)与物料的产品结构中子件的损坏率(SCRAP)是不同的.子件的损坏率导致个别父件的子件产生额外的需求.而一个产品的产出率小于100%时,MRP会产生额外的损坏需求造成这个成品与所有他的子件将会超发.[@more@]