- 浏览: 130718 次
- 性别:
- 来自: 上海
最新评论
-
78425665:
请问下,eclemma怎么用在tomcat部署的项目中
5.1 每个项目最重要的十件事 -
jaisok:
呵呵,挺好的
struts-config中action的attribute属性与name属性的关系 -
minma_yuyang:
能不能简单点,我才入门,
build xml
5. Given:
public class Foo {
public static void main (String [] args) {
StringBuffer a = new StringBuffer("A");
StringBuffer b = new StringBuffer ("B");
operate (a,b);
System.out.println(a + "," +b);
}
static void operate(StringBuffer x, StringBuffer y) {
x.append(y);
y = x;
}
}
===================== http://www.opcol.com/
6. Given:
public class Test {
public static void stringReplace (String text) {
text = text.replace('j', 'i');
}
public static void bufferReplace (StringBuffer text) {
text = text.append ('c');
}
public static void main (String args[]) {
String textString = new String ("java");
StringBuffer textBuffer = new StringBuffer("java");
stringReplace(textString);
bufferReplace(textBuffer);
System.out.println (textString + textBuffer);
}
}
=======================
public class Test {
public static void add3(Integer i) {
int val = i.intValue();
val += 3;
i = new Integer(val);
}
public static void main(String args[]){
Integer i = new Integer(0);
add3 (i);
System.out.println (i.intValue());
}
}
====================
18. Which three are valid declarations of a float? (Choose Three)
A. float foo = -1;
B. float foo = 1.0;
C. float foo = 42e1;
D. float foo = 2.02f;
E. float foo = 3.03d;
F. float foo = 0x0123;
========================
15. Given:
interface Foo {
int k = 0; //line 2
}
public class Test implements Foo {
public static void main(String args[]) {
int i;
Test test = new Test();
i = test.k; //8
i = Test.k; //9
i = Foo.k; //10
}
}
============================
22. Given:
public class Foo {
public static void main (String[] args) {
String s;
System.out.println (“s=” + s);
}
}
=============================
26. Given:
public class test{
public int aMethod(){
static int i=0;
i++;
return i;
}
public static void main (String args[]){
test test = new test();
test.aMethod();
int j = test.aMethod();
System.out.printIn(j);
}
}
What is the result?
A. Compilation will fail.
B. Compilation will succeed and the program will print “0”.
C. Compilation will succeed and the program will print “1”.
D. Compilation will succeed and the program will print “2”.
==========================
27. Given:
class Super {
public float getNum() {return 3.0f;}
}
public class Sub extends Super {
//line 5
)
Which method, placed at line 5, will cause a compiler error?
A. public float getNum() { return 4.0f; }
B. public void getNum() {}
C. public void getNum(double d) {}
D. public double getNum(float d) {retrun 4.0f; }
==========================
29. Given:
byte [] array1, array2[];
byte array3 [][];
byte[][] array4;
If each array has been initialized, which statement will cause a compiler error?
A. array2 = array1;
B. array2 = array3;
C. array2 = array4;
D. both A and B
E. both A and C
F. both B and C
=========================
52. Given:
public class Test {
public static String output = "";
public static void foo(int i) {
try {
if(i==1) {
throw new Exception ();
}
output += "1";
} catch(Exception e) {
output += “2”;
return;
} finally (
output += “3”;
}
output += “4”;
}
public static void main (String args[]) (
foo(0);
foo(1);
//line 24
}
)
=========================
53. Given:
public class Foo implements Runnable { //line 1
public void run (Thread t) { //line 2
System.out.println("Running.");
}
public static void main (String[] args) {
new Thread(new Foo()).start();
}
}
========================
59. Given:
public class X implements Runnable {
private int x;
private int y;
public static void main(String[] args) {
X that = new X();
(new Thread(that)).start(); //line 7
(new Thread(that)).start(); //line 8
}
public synchronized void run{} { //line 11
for (;;) {
x++;
y++;
System.out.println(“x = “ + x + “, y = “ + y);
}
}
}
===============================
61. Given:
public class SyncTest{
public static void main(String[] args) {
final StringBuffer s1= new StringBuffer();
final StringBuffer s2= new StringBuffer();
new Thread () {
public void run() {
synchronized(s1) {
s2.append(“A”);
synchronized(s2) {
s2.append(“B”);
System.out.print(s1);
System.out.print(s2);
}
}
}
}.start();
new Thread() {
public void run() {
synchronized(s2) {
s2.append(“C”);
synchronized(s1)
s1.append(“D”);
System.out.print(s2);
System.out.print(s1);
}
}
}
}.start();
}
}
Which two statements are true? (Choose Two)
A. The program prints “ABBCAD”
B. The program prints “CDDACB”
C. The program prints “ADCBADBC”
D. The output is a non-deterministic point because of a
possible deadlock condition
E. The output is dependent on the threading model of the
system the program is running on.
============================
68. Given:
class A {
public int getNumber(int a) {
return a + 1;
}
}
class B extends A {
public int getNumber(int a) {
return a + 2; //line 8
}
public static void main (String args[]) {
A a = new B(); //line 13
System.out.println(a.getNumber(0)); //line 14
}
}
What is the result?
A. Compilation succeeds and 1 is printed.
B. Compilation succeeds and 2 is printed.
C. An error at line 8 causes compilation to fail.
D. An error at line 13 causes compilation to fail.
E. An error at line 14 causes compilation to fail.
Answer: B
========================
public class Foo {
public static void main (String [] args) {
StringBuffer a = new StringBuffer("A");
StringBuffer b = new StringBuffer ("B");
operate (a,b);
System.out.println(a + "," +b);
}
static void operate(StringBuffer x, StringBuffer y) {
x.append(y);
y = x;
}
}
===================== http://www.opcol.com/
6. Given:
public class Test {
public static void stringReplace (String text) {
text = text.replace('j', 'i');
}
public static void bufferReplace (StringBuffer text) {
text = text.append ('c');
}
public static void main (String args[]) {
String textString = new String ("java");
StringBuffer textBuffer = new StringBuffer("java");
stringReplace(textString);
bufferReplace(textBuffer);
System.out.println (textString + textBuffer);
}
}
=======================
public class Test {
public static void add3(Integer i) {
int val = i.intValue();
val += 3;
i = new Integer(val);
}
public static void main(String args[]){
Integer i = new Integer(0);
add3 (i);
System.out.println (i.intValue());
}
}
====================
18. Which three are valid declarations of a float? (Choose Three)
A. float foo = -1;
B. float foo = 1.0;
C. float foo = 42e1;
D. float foo = 2.02f;
E. float foo = 3.03d;
F. float foo = 0x0123;
========================
15. Given:
interface Foo {
int k = 0; //line 2
}
public class Test implements Foo {
public static void main(String args[]) {
int i;
Test test = new Test();
i = test.k; //8
i = Test.k; //9
i = Foo.k; //10
}
}
============================
22. Given:
public class Foo {
public static void main (String[] args) {
String s;
System.out.println (“s=” + s);
}
}
=============================
26. Given:
public class test{
public int aMethod(){
static int i=0;
i++;
return i;
}
public static void main (String args[]){
test test = new test();
test.aMethod();
int j = test.aMethod();
System.out.printIn(j);
}
}
What is the result?
A. Compilation will fail.
B. Compilation will succeed and the program will print “0”.
C. Compilation will succeed and the program will print “1”.
D. Compilation will succeed and the program will print “2”.
==========================
27. Given:
class Super {
public float getNum() {return 3.0f;}
}
public class Sub extends Super {
//line 5
)
Which method, placed at line 5, will cause a compiler error?
A. public float getNum() { return 4.0f; }
B. public void getNum() {}
C. public void getNum(double d) {}
D. public double getNum(float d) {retrun 4.0f; }
==========================
29. Given:
byte [] array1, array2[];
byte array3 [][];
byte[][] array4;
If each array has been initialized, which statement will cause a compiler error?
A. array2 = array1;
B. array2 = array3;
C. array2 = array4;
D. both A and B
E. both A and C
F. both B and C
=========================
52. Given:
public class Test {
public static String output = "";
public static void foo(int i) {
try {
if(i==1) {
throw new Exception ();
}
output += "1";
} catch(Exception e) {
output += “2”;
return;
} finally (
output += “3”;
}
output += “4”;
}
public static void main (String args[]) (
foo(0);
foo(1);
//line 24
}
)
=========================
53. Given:
public class Foo implements Runnable { //line 1
public void run (Thread t) { //line 2
System.out.println("Running.");
}
public static void main (String[] args) {
new Thread(new Foo()).start();
}
}
========================
59. Given:
public class X implements Runnable {
private int x;
private int y;
public static void main(String[] args) {
X that = new X();
(new Thread(that)).start(); //line 7
(new Thread(that)).start(); //line 8
}
public synchronized void run{} { //line 11
for (;;) {
x++;
y++;
System.out.println(“x = “ + x + “, y = “ + y);
}
}
}
===============================
61. Given:
public class SyncTest{
public static void main(String[] args) {
final StringBuffer s1= new StringBuffer();
final StringBuffer s2= new StringBuffer();
new Thread () {
public void run() {
synchronized(s1) {
s2.append(“A”);
synchronized(s2) {
s2.append(“B”);
System.out.print(s1);
System.out.print(s2);
}
}
}
}.start();
new Thread() {
public void run() {
synchronized(s2) {
s2.append(“C”);
synchronized(s1)
s1.append(“D”);
System.out.print(s2);
System.out.print(s1);
}
}
}
}.start();
}
}
Which two statements are true? (Choose Two)
A. The program prints “ABBCAD”
B. The program prints “CDDACB”
C. The program prints “ADCBADBC”
D. The output is a non-deterministic point because of a
possible deadlock condition
E. The output is dependent on the threading model of the
system the program is running on.
============================
68. Given:
class A {
public int getNumber(int a) {
return a + 1;
}
}
class B extends A {
public int getNumber(int a) {
return a + 2; //line 8
}
public static void main (String args[]) {
A a = new B(); //line 13
System.out.println(a.getNumber(0)); //line 14
}
}
What is the result?
A. Compilation succeeds and 1 is printed.
B. Compilation succeeds and 2 is printed.
C. An error at line 8 causes compilation to fail.
D. An error at line 13 causes compilation to fail.
E. An error at line 14 causes compilation to fail.
Answer: B
========================
- editPlus310_en.zip (981.9 KB)
- 下载次数: 0
发表评论
-
weblogic doc
2010-06-22 14:33 702http://edocs.weblogicfans.net/w ... -
中文字判断
2010-05-13 17:07 857中文字判断 <td width="14%&qu ... -
html sort
2010-05-10 16:49 711<table width="100%" ... -
Jmeter
2010-04-28 17:37 990http://www.cnblogs.com/jackei/a ... -
native2ascii
2010-02-23 10:59 997native2ascii -encoding UTF-8 Me ... -
CronTrigger配置
2009-09-04 09:54 891CronTrigger配置格式: 格 ... -
頁面禁止用F11
2009-08-19 17:48 1180function filter(){ if (event ... -
Eclipse不能自动编译工程的解决方法
2009-07-04 21:31 1031目录下也是空的. 具体都操作了: 打开project-> ... -
jmeter
2009-07-01 22:33 1060http://www.51testing.com/?uid-1 ... -
jdbc batchsize
2009-06-27 14:40 1336LocalSessionFactoryBean.getConf ... -
date
2009-06-24 23:50 917public class DateUtil { ... -
POI
2009-05-24 21:53 1330package poi.metrics; import ja ... -
effective java
2009-04-19 21:47 1132第一条: 内容:静态工厂替代构造函数 例子:String.va ... -
ServletContext与ServletConfig的分析
2009-03-31 23:22 888对于web容器来说,ServletContext接口定义了一个 ... -
接口和抽象类
2009-03-31 11:30 7911.abstract class 在 Java 语言中表示的是 ... -
关于数组转型的问题
2009-03-31 08:41 794一个Object[]无法转换Integer[] ... -
【Spring】Spring中WebApplicationContext的研究
2009-03-12 16:10 738ApplicationContext是Spring的核心,Co ... -
图形程序设计
2009-03-06 16:20 1427http://hi.baidu.com/filoplume/b ... -
JAVA文件中获取该项目的相对路径方法
2009-03-06 09:30 18421.基本概念的理解 绝对路径:绝对路径就是你的主页上的文 ... -
java copy and delete file
2009-03-05 22:36 3177import java.io.*; public ...
相关推荐
Problem Solving with C++, Global Edition by Walter Savitch (author) (Author) Pages:1117 出版社: Pearson Education Limited; 10th edition edition (November 20, 2017) Language: English ISBN-10: ...
《Problem Solving with C++ 第七版》是由Walter Savitch所著的一本经典的C++编程教材。本书通过大量的实例和项目练习,详细讲解了C++程序设计的基础知识、编程思想和技巧。本书内容详实,覆盖面广,从最基本的编译...
Problem_C_Data.zip The three data sets provided contain product user ratings and reviews extracted from the Amazon Customer Reviews Dataset thru Amazon Simple Storage Service (Amazon S3). hair_dryer....
W ELCOME TO THE F IFTH EDITION OF C++ Programming: From Problem Analysis to Program Design. Designed for a first Computer Science (CS1) C++ course, this text provides a breath of fresh air to you and ...
"Problem_C_Data.zip" 是一个压缩包文件,包含2020年美国数学建模竞赛(简称美赛)C题的题目及相应的原始数据。美赛是一项国际性的数学建模竞赛,每年吸引众多学生参与,旨在提升参赛者的数学、数据分析和解决实际...
Approaching (Almost) Any Machine Learning Problem是一本旨在帮助读者掌握机器学习问题解决方法的书籍。这本书涵盖了机器学习的基本概念、模型选择、数据预处理、特征工程、模型评估等多方面的知识点。 机器学习...
Title: Computer-Based Problem Solving Process Author: Teodor Rus Length: 350 pages Edition: 1 Language: English Publisher: World Scientific Publishing Company Publication Date: 2015-05-30 ISBN-10: ...
Problem Solving with Algorithms and Data Structures using Python 中文版 PythonDS Cover By Brad Miller and David Ranum, Luther College ---------------------------------------------------- 本 PDF 基于...
在这个特定的问题“master page search problem”中,我们可能遇到的是在使用Master Page时搜索功能出现的问题。ViewData是ASP.NET MVC框架中的一个特性,用于在控制器和视图之间传递数据,而JavaScript则是客户端...
"Problem Solving with Algorithms and Data Structures using Python"是一本专注于利用Python语言学习算法和数据结构的教材,其第二版的网站提供了丰富的学习资源,包括实例、练习和解决方案,旨在帮助开发者深入...
《C++ Programming From Problem Analysis to Program Design 8th》是一本深入浅出的C++编程教程,由资深计算机教育家Zelle撰写。该书旨在帮助读者从问题分析到程序设计的整个过程,全面掌握C++语言。最新版更新至...
总之,《Spring Recipes A Problem-Solution Approach》是一本非常实用的Spring框架学习资料,对于希望深入了解Spring 2.5及其在企业级Java应用开发中的应用的开发者来说,本书无疑是不可或缺的参考书目。
《C# Programming From Problem Analysis to Program Design》第四版是一本深入浅出的C#编程教程,旨在引导读者从问题分析到程序设计的全过程。这本书专为初学者和有一定经验的程序员设计,通过全面覆盖C#语言的核心...
Problem Solving with C++(9th) 英文无水印pdf 第9版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请...
在物流、仓储及制造业等领域,如何高效地利用有限的空间来装载物品是一个重要的优化问题,这就是所谓的“三维装箱问题”(3D Bin Packing Problem)。它涉及到如何在有限数量的三维箱子中,以最小的空间浪费来容纳...
node-problem-detector 镜像包 v0.8.7 版本
Problem Solving in Data Structures & Algorithms Using C# 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除