Weblogic培训试题

本文包含20道Java编程挑战题目,涉及主方法声明、JSP事务处理、标识符定义、字符串操作等方面,旨在帮助读者加深对Java核心概念的理解。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一共20道题目。

Question 1.
Which declaration of the main method below would allow a class to be started as a standalone program. Select the one correct answer.
A.  public static int main(char args[])
B.  public static void main(String args[])
C.  public static void MAIN(String args[]
D.  public static void main(String args)
E.  public static void main(char args[])

Question 2.
From a JSP within WebLogic, how do you obtain a reference to a javax.transaction.UserTransaction object?
A.  Instantiate a new UserTransaction object within a scriptlet.
B.  Use the built in transaction object.
C.  JSPs cannot use transactions.
D.  Lookup the UserTransaction object bound in the JNDI tree. 

Question 3.
Which of the following is true with respect to the JTA setRollbackOnly method?
A.  setRollbackOnly does not cause the rollback to commence immediately
B.  setRollbackOnly is valid only if the current thread is the transaction initiator
C.  setRollbackOnly is valid only if the current principal has administrator privileges
D.  setRollbackOnly is valid only if a majority of the transaction participants agree to rollback the transaction

Question 4.
Which declarations of identifiers are legal?
A. $persons
B. TwoUsers
C. *point
D. this
E. _endline

Question 5.
Which of the following fragments might cause errors?
A.  String s = "Gone with the wind";
     String t = " good ";
     String k = s + t;
B.  String s = "Gone with the wind";
     String t;
     t = s[3] + "one";
C.  String s = "Gone with the wind";
     String standard = s.toUpperCase();
D.  String s = "home directory";
     String t = s - "directory".

Question 6.
String s = "hello";
String t = "hello";
char c[] = ;
Which return true?
A. s.equals(t);
B. t.equals(c);
C. s==t;
D. t.equals(new String("hello"));
E. t==C.

Question 7.
Given the following code:
public class Person{
int arr[] = new int[10];
public static void main(String a[]) {
System.out.println(arr[1];)
}
}
Which statement is correct?
A. When compilation some error will occur.
B. It is correct when compilation but will cause error when running.
C. The output is zero.
D. The output is null.

Question 8.
JDBC DataSource is directly mapped to what WLS-managed resource?
A.  A JDBC Driver
B.  A Connection Pool
C.  An XA-compliant Resource Manager
D.  A WLS Principal and Database Connection pair

Question 9.
Which is a difference between an entity bean home interface and a session bean home interface?
A.  They extend (inherit) different interfaces
B.  The session home interface cannot have any finder methods
C.  A session home interface is guaranteed to have only one create method
D.  An entity home interface is guaranteed to have at least one create method

Question 10
If a WebLogic server is booted without designating it as an administrative or managed server, what happens?
A.  It boots as a managed server
B.  It boots as an administrative server
C.  Boot is guaranteed to fail (with a graceful exit)
D.  Server will boot in the same mode as the previous boot

Question 11
Which of the following statements are true?
A. The equals() method determines if reference values refer to the same object.
B. The == operator determines if the contents and type of two separate objects match.
C. The equals() method returns true only when the contents of two objects match.
D. The class File overrides equals() to return true if the contents and type of two separate objects match.

Question 12
In a WAR file, in which folder is weB.xml placed?
A.  WEB-INF
B.  APP-INF
C.  META-INF
D.  WEB-INF/lib
E.  None of these

Question 13
In an application, you want to transfer control to some other resource, which of the following tag will be used:
A.  jsp:callback
B.  jsp:forward
C.  jsp:include
D.  jsp:fallback
E.  jsp:useBean

Question 14
You are using one SLSB to invoke methods in multiple Entity EJBs which implement local interface, which exception will be caught:
A.  javax.ejB.EJBException;
B.  javax.ejB.LocalException;
C.  javax.ejB.LocalBeanException;
D.  javax.rmi.RemoteException;
E.  javax.ejB.RemoteException;

Question 15.
A Logout servlet in a web app, which method can be called in this servlet:
A.  out.clear()
B.  out.flush()
C.  session.clear()
D.  session.flush()
E.  session.invalidate()

Question  16.
A ejb named ejbC and how to call this ejb by ejb env varible.
A.  initCtx.lookup("java:comp/env/ejb/ejbC")
B.  initCtx.lookup("java:comp/ejb/ejbC")
C.  initCtx.lookup("java:comp/ejbC")
D.  initCtx.lookup("java:comp/env/ejbC")

Question 17.
When starting a managed server as a service or daemon, which statement is true?
A.  The managed server must be started by NodeManager
B.  The managed server should check for the availability of an Admin Server
C.  A managed server cannot be started as a service or daemon
D.  The managed server must run as root or Administrator
E.  The managed server should attempt to start NodeManager, if is not running  already

Question 18.
Consider a managed server that has one NIC card and two virtual hosts, foo.com and bar.com, with default Web applications. The managed server listen address is 192.168.1.123 The listen port is 80. Which URL can a client use to access bar.com?
A.  http:// 192.168.1.123
B.  http:// 192.168.1.123:80/bar
C.  http:// bar.com
D.  http:// 192.168.1.123 /bar.com
E.  A and C

Question 19.
One managed server does not seem to be responding. Taking which action does NOT shut it down?
A.  "Graceful shutdown of this server¡­" in the Admin Console
B.  "Force shutdown of this server¡­" in the Admin Console
C.  UNIX kill process
D.  Windows Task Manager
E.  All of these actions shut it down

Question 20.
Which built-in WebLogic administration feature can help detect the presence of memory leaks?
A.  The -DWebLogiC.LeakDetect=true flag
B.  Leak monitoring through NodeManager
C.  Forcing Garbage Collection in the Admin Console
D.  The MemoryMonitor MBean
E.  Memory subsystem messages in the server logs

资源下载链接为: https://pan.quark.cn/s/f989b9092fc5 今天给大家分享一个关于C#自定义字符串替换方法的实例,希望能对大家有所帮助。具体介绍如下: 之前我遇到了一个算法题,题目要求将一个字符串中的某些片段替换为指定的新字符串片段。例如,对于源字符串“abcdeabcdfbcdefg”,需要将其中的“cde”替换为“12345”,最终得到的结果字符串是“ab12345abcdfb12345fg”,即从“abcdeabcdfbcdefg”变为“ab12345abcdfb12345fg”。 经过分析,我发现不能直接使用C#自带的string.Replace方法来实现这个功能。于是,我决定自定义一个方法来完成这个任务。这个方法的参数包括:原始字符串originalString、需要被替换的字符串片段strToBeReplaced以及用于替换的新字符串片段newString。 在实现过程中,我首先遍历原始字符串,查找需要被替换的字符串片段strToBeReplaced出现的位置。找到后,就将其替换为新字符串片段newString。需要注意的是,在替换过程中,要确保替换操作不会影响后续的查找和替换,避免遗漏或重复替换的情况发生。 以下是实现代码的大概逻辑: 初始化一个空的字符串result,用于存储最终替换后的结果。 使用IndexOf方法在原始字符串中查找strToBeReplaced的位置。 如果找到了,就将originalString中从开头到strToBeReplaced出现位置之前的部分,以及newString拼接到result中,然后将originalString的查找范围更新为strToBeReplaced之后的部分。 如果没有找到,就直接将剩余的originalString拼接到result中。 重复上述步骤,直到originalStr
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值