范文为教学中作为模范的文章,也常常用来指写作的模板。常常用于文秘写作的参考,也可以作为演讲材料编写前的参考。大家想知道怎么样才能写一篇比较优质的范文吗?以下是小编为大家收集的优秀范文,欢迎大家分享阅读。
Java编程入门篇一
计算器
班级:****** 姓名:******
学号: ******* 指导老师:******
实验名称:java计算器
1实验目的: java编程语言在编程方面的具体应用,以及使用面向对象方法,对小应用程序进行需求分
析、概要设计、详细设计,最后使用java编程实现的全过程。
2实验意义:
在编程我们使用的java语言,是目前比较流行的编程语言。在当今这个时代,java语言在编程方面的优势使得编程有了更好的选择。java语言最大的特点是具有跨平台性,使其不受平台不同的影响,得到了广泛的应用。实训性质
本课程是计算机信息管理专业的一门实践性课程,是《java编程》课程的实践性教学环节。实训目标
⑴综合应用java程序设计的知识解决实际问题。
⑵学会在应用程序的设计过程中,应用面向对象的程序设计方法。⑶学会应用jdbc创建数据库应用程序。
⑷学会开发基于swing的应用程序及多文档应用程序的设计。实训任务
用java语言开发工具(例如jdk、jcreator、netbeans等)制作一个简单的可运行的完整的应用程序或小型系统,并编制出各阶段必要的文档。
将创建一个计算器,可以进行常用的加减乘除算术运算。本实例的知识点有:窗口布局器gridlayout的应用,对按钮消息的监听和响应。
6实训条件
<软件:>windows xp,netbeans ide 6.52 7开发背景: java是由sun microsystems公司于1995年5月推出的java程序设计语言(以下简称java语言)和java平台的总称。java语言是一个支持网络计算的面向对象程序设计语言。java语言吸收了smalltalk语言和c++语言的优点,并增加了其它特性,如支持并发程序设计、网络通信、和多媒体数据控制等。
8系统部分分析:
1)java语言是简单的。java语言的语法与c语言和c++语言很接近,使得大多数程序员很容易学习和使用java。另一方面,java丢弃了c++ 中很少使用的、很难理解的、令人迷惑的那些特性,如操作符重载、多继承、自动的强制类型转换。
2)java语言是一个面向对象的。java语言提供类、接口和继承等原语,为了简单起见,只支持类之间的单继承,但支持接口之间的多继承,并支持类与接口之间的实现机制(关键字为implements)。java语言全面支持动态绑定,而c++ 语言只对虚函数使用动态绑定
3)java语言是分布式的。java语言支持internet应用的开发,在基本的java应用编程接口中有一个网络应用编程接口(),它提供了用于网络应用编程的类库,包括url、urlconnection、socket、serversocket等。java的rmi(远程方法激活)机制也是开发分布式应用的重要手段。
4)java语言是健壮的。java的强类型机制、异常处理、废料的自动收集等是java程序健壮性的重要保证。对指针的丢弃是java的明智选择。java的安全检查机制使得java更具健壮性。
5)java语言是安全的。java通常被用在网络环境中,为此,java提供了一个安全机制以防恶意代码的攻击。除了java语言具有的许多安全特性以外,java对通过网络下载的类具有一个安全防范机制(类classloader),如分配不同的名字空间以防替代本地的同名类、字节代码检查,并提供安全管理机制.6)java语言是体系结构中立的。java程序(后缀为java的文件)在java平台上被编译为体系结构中立的字节码格式(后缀为class的文件), 然后可以在实现这个java平台的任何系统中运行。
7)java语言是可移植的。这种可移植性来源于体系结构中立性,另外,java还严格规定了各个基本数据类型的长度。java系统本身也具有很强的可移植性,java编译器是用java实现的.8)java语言是解释型的。如前所述,java程序在java平台上被编译为字节码格式,然后可以在实现这个java平台的任何系统中运行。
9)java是高性能的。与那些解释型的高级脚本语言相比,java的确是高性能的。事实上,java的运行速度随着jit(just-in-time)编译器技术的发展越来越接近于c++。
10)java语言是多线程的。在java语言中,线程是一种特殊的对象,它必须由thread类或其子(孙)类来创建。
11)java语言是动态的。java语言的设计目标之一是适应于动态变化的环境。
目录
课程设计题目 ……………………………… p1
课程设计简介 ……………………………… p2
课程设计源代码…………………………… p5
课程设计运行结果 ……………………… p15 课程设计心得体会 ………………………
p16
package computerpad;import .*;import .event.*;import .*;import .*;import list;import format;public class computerpad extends frame implements actionlistener {
numberbutton numberbutton[];
operationbutton oprationbutton[];
button 小数点按钮,正负号按钮,退格按钮,求倒数按钮,等号按钮,清零按钮;
panel panel;
jtextfield resultshow;
string 运算符号[]={“+”,“-”,“*”,“/”};
linkedlist 链表;
boolean 是否按下等号=false;
public computerpad()
{
super(“计算器”);
链表=new linkedlist();
numberbutton=new numberbutton[10];
for(int i=0;i<=9;i++)
{
numberbutton[i]=new numberbutton(i);
numberbutton[i].addactionlistener(this);
}
oprationbutton=new operationbutton[4];
for(int i=0;i<4;i++)
{
oprationbutton[i]=new operationbutton(运算符号[i]);
oprationbutton[i].addactionlistener(this);
}
小数点按钮=new button(“.”);
正负号按钮
=new button(“+/-”);
等号按钮=new button(“=”);
求倒数按钮=new button(“1/x”);
退格按钮=new button(“退格”);
清零按钮=new button(“c”);
eground();
eground();
eground();
eground();
eground();
eground();
ionlistener(this);
ionlistener(this);
ionlistener(this);
ionlistener(this);
ionlistener(this);
ionlistener(this);
resultshow=new jtextfield(10);
izontalalignment();
eground();
t(new font(“timesroman”,,14));
der(new softbevelborder(d));
kground();
table(false);
panel=new panel();
out(new gridlayout(4,5));
(numberbutton[1]);
(numberbutton[2]);
(numberbutton[3]);
(oprationbutton[0]);
(清零按钮);
(numberbutton[4]);
(numberbutton[5]);
(numberbutton[6]);
(oprationbutton[1]);
(退格按钮);
(numberbutton[7]);
(numberbutton[8]);
(numberbutton[9]);
(oprationbutton[2]);
(求倒数按钮);
(numberbutton[0]);
(正负号按钮);
(小数点按钮);
(oprationbutton[3]);
(等号按钮);
add(panel,);
add(resultshow,);
addwindowlistener(new windowadapter()
{ public void windowclosing(windowevent e)
{
(0);
}
});
setvisible(true);
setbounds(100,50,240,180);
setresizable(false);
validate();
} public void actionperformed(actionevent e)
{
if(rce()instanceof numberbutton)
{
numberbutton b=(numberbutton)rce();
if(()==0)
{
int number=ber();
(“"+number);
t(”“+number);
是否按下等号=false;
}
else if(()==1&&是否按下等号==false)
{
int number=ber();
string num=(string)first();
string s=(”“+number);
(0,s);
t(s);
}
else if(()==1&&是否按下等号==true)
{
int number=ber();
first();
(”“+number);
是否按下等号=false;
t(”“+number);
}
else if(()==2)
{
int number=ber();
(”“+number);
t(”“+number);
}
else if(()==3)
{
int number=ber();
string num=(string)t();
string s=(”“+number);
(2,s);
t(s);
}
}
else if(rce()instanceof operationbutton)
{
operationbutton b=(operationbutton)rce();
if(()==1)
{
string fuhao=运算符号();
(fuhao);
}
else if(()==2)
{
string fuhao=运算符号();
(1,fuhao);
}
else if(()==3)
{
string fuhao=运算符号();
string number1=(string)first();
string number2=(string)t();
string 运算符号=(string)(1);
try
{
double n1=ouble(number1);
double n2=ouble(number2);
double n=0;
if((”+“))
{
n=n1+n2;
}
else if((”-“))
{
n=n1-n2;
}
else if((”*“))
{
n=n1*n2;
}
else if((”/“))
{
n=n1/n2;
}
();
(”“+n);
(fuhao);
t(”“+n);
}
catch(exception ee)
{
}
}
}
else if(rce()==等号按钮)
{
是否按下等号=true;
if(()==1||()==2)
{
string num=(string)first();
t(”“+num);
}
else if(()==3)
{
string number1=(string)first();
string number2=(string)t();
string 运算符号=(string)(1);
try
{
double n1=ouble(number1);
double n2=ouble(number2);
double n=0;
if((”+“))
{
n=n1+n2;
}
else if((”-“))
{
n=n1-n2;
}
else if((”*“))
{
n=n1*n2;
}
else if((”/“))
{
n=n1/n2;
}
t(”“+n);
(0,”“+n);
last();
last();
}
catch(exception ee)
{
}
}
}
else if(rce()==小数点按钮)
{
if(()==0)
{
是否按下等号=false;
}
else if(()==1)
{
string dot=el();
string num=(string)first();
string s=null;
if(f(dot)==-1)
{
s=(dot);
(0,s);
}
else
{
s=num;
}
(0,s);
t(s);
}
else if(()==3)
{
string dot=el();
string num=(string)t();
string s=null;
if(f(dot)==-1)
{
s=(dot);
(2,s);
}
else
{
s=num;
}
t(s);
}
}
else if(rce()==退格按钮)
{
if(()==1)
{
string num=(string)first();
if(()>=1)
{
num=ing(0,()-1);
(0,num);
t(num);
}
else
{
last();
t(”0“);
}
}
else if(()==3)
{
string num=(string)t();
if(()>=1)
{ num=ing(0,()-1);
(2,num);
t(num);
}
else
{
last();
t(”0“);
}
}
}
else if(rce()==正负号按钮)
{
if(()==1)
{
string number1=(string)first();
try
{
double d=ouble(number1);
d=-1*d;
string str=f(d);
(0,str);
t(str);
}
catch(exception ee)
{
}
}
else if(()==3)
{
string number2=(string)t();
try
{
double d=ouble(number2);
d=-1*d;
string str=f(d);
(2,str);
t(str);
}
catch(exception ee){
}
}
}
else if(rce()==求倒数按钮)
{
if(()==1||()==2)
{
string number1=(string)first();
try
{
double d=ouble(number1);
d=1.0/d;
string str=f(d);
(0,str);
t(str);
}
catch(exception ee){
}
}
else if(()==3)
{
string number2=(string)t();
try
{
double d=ouble(number2);
d=1.0/d;
string str=f(d);
(0,str);
t(str);
}
catch(exception ee){
}
}
}
else if(rce()==清零按钮)
{
是否按下等号=false;
t(”0“);
();
}
} public static void main(string args[])
{
new computerpad();
}
}
package computerpad;import .*;import .event.*;import .*;public class numberbutton extends button {
int number;
public numberbutton(int number)
{
super(”"+number);
=number;
setforeground();
}
public int getnumber()
{
return number;
} }
import .*;import .event.*;import .*;public class operationbutton extends button {
string 运算符号;
public operationbutton(string s)
{
super(s);
运算符号=s;
setforeground();
}
public string get运算符号()
{
return 运算符号;
} } 14 java实训心得:
未接触java之前,听人说java这门语言如何的强大和难以入门,但学习之后,给我的感觉却是语言没有所谓的难于不难,关键是自己有没有真正投入去学,有没有花时间去学。java是一门很好的语言,经过周围人对java的宣传,我一开始不敢去学习这门语言,因为一门高级语言总是让人想到一开始的学习会很难,但是后来在自己的努力和老师同学的帮助下,我加入了java学习者的行列。
老师把我们带进了门,那么,以后漫长的深入学习还是要靠自己。经常性的编写一些程序,或则去看懂、研究透别人编写的程序对于我们打好基础是非常有利的。让我们怀着对java的一腔热情,用自己的刻苦努力去把java学好。将来,用自己的成绩去回报有恩于我们的社会、家人和朋友。
Java编程入门篇二
1.什么是gui?
a)gui是graphics user interface的全称,意思是图形用户界面.2.为什么需要gui?
a)图形用户界面能够让最终用户通过鼠标拖动、单击等动作就可以操作整个应用,从而提高应用的用户体验效果,
a)awt是sun公司提供的一个基本的gui类库,被称为抽象工具集(abstract
window-toolkit),它为java应用程序提供了基本的组件.b)awt组件需要调用运行平台的图形界面来创建和平台一致的对等体,所以awt只
能使用所有平台都支持的公共组件,因此awt只能够提供一些 的主要组成部分
a)component,代表一个具体图形表示能力的对象,可以在屏幕上显示,并与用户交互.通常我们把它称为”组件”.b)menucomponent,r,,em,代表一个菜单项.c)container,代表一个awt组件容器,可以盛装其他commponent组件,它继承自
component抽象类,,,,代表一个对话框
a)filedialog代表一个文件对话框,,可容纳其他组件,但不能独立存在,必须被添加到其他容器中.ii.scrollpane,带滚动条的容器.d)layoutmanager,布局管理器,yout,流式布局,layout,边框布局,只能盛装5个组件,yout,网格布局,glayout,网格包布局,一种较为复杂的布局管理器,yout,卡片布局,以时间来管理容器内的组件,将组件看作是一张张卡片,每次显示最外面一张卡片(组件).boxlayou,箱式布局, 的事件
a)应用程序响应用户的某个动作或请求,如用户单击了一下鼠标,用户请求关闭应用
程序窗口等.b)awt编程中,所有事件的处理都必须交给特定的对象来完成,我们将这个特定的对
象称为事件监听器.c)awt的事件处理机制是一种委派式的事件处理方式,通过将某个事件监听器注册
到用户指定的组件,当用户进行某个操作并触发指定事件时,应用程序会自动产生一个事件(event)对象并作为参数传给事件监听器中的事件处理器,然后由事件监
听器通知事件处理器来响应用户,完成用户的请求.d)不同的事件需要不同的事件监听器,不同的监听器需要实现不同的监听器接口.e)事件监听器接口:为某个特定事件定义了响应用户请求的方法,当用户将某个事件
监听器注册到指定组件上以响应特定的事件时,则该事件监听器必须实现对应的事件监听器接口才能对用户的请求进行有效处理.例如,用户点击了鼠标右键,希望打开某个应用程序的右键菜单,则注册到该应用程序上的事件监听器必须实现鼠标事件监听器接口,并实现该接口内部某些方法来完成用户的请求.f)事件适配器,很多时候,我们只需要实现某个事件监听器接口中个别方法就能完成应用程序的实际需求,但实现该事件监听器接口的类必须实现该接口中所有的抽象方法,这会造成代码的冗余.而事件适配器可以帮我们解决这个问题,事件适配器实现了所有的拥有多个抽象方法的事件监听器接口,并空实现了这些接口中所有的抽象方法,所谓空实现,就是方法中没有任何实现代码,因此,我们可以通过继承对应事件监听器接口的事件适配器抽象类,并实现我们感兴趣的方法来完成应用需求即可.g)java事件处理过程中主要涉及的三类对象
i.事件源,.事件,通常指用户的某个操作,如单击了一下鼠标,.事件监听器,负责监听事件源上所发生的事件,并作出响应.h)awt事件监听器的实现形式
.内部类形式 顶级类形式
iii.类本身作为事件监听器
iv.匿名内部类形式
v.注:绘图
a)awt绘图的实现过程.i.重写画布类的paint方法,.调用component类的repaint方法绘制图形.b)awt实现绘图主要涉及的对象
.c)component类的子类canvas类,cs,代表一个画笔,类代表了位图,它的一个主要的实现类bufferedimage是可以访问图形数据
缓冲区,并可以返回一个graphics对象来绘制该buuferedimage.d)的优缺点
a)awt在许多非桌面环境,如嵌入式设备中有着自己的优势,它的主要优点如下:.iv.更少的内存:对运行在有限环境中的gui程序的开发,是合适的。2.更少的启动事件:由于awt组件是本地由操作系统实现的。绝大多数的二进制代码已经在如系统启动的时候被预装载了,这降低了它的启动事件。3.更好的响应:由于本地组件由操作系统渲染。4.成熟稳定的:能够正常工作并很少使你的程序崩溃。
b)同样它也有不少的缺点
.更少组件类型:表和树这些重要的组件缺失了。它们是桌面应用程序中普遍使用的。2.缺乏丰富的组件特征:按钮不支持图片。3.无扩展性:awt的组件是本地组件。jvm中的awt类实例实际只是包含本地
组件的引用。唯一的扩展点是awt的canvas组件,可以从零开始创建自定义组
件。然而无法继承和重用一个已有的awt组件
总结:awt是sun不推荐使用的工具集,实际开发中很少使用awt而是使用sun公司
和netscape公司共同开发的一个新的用户界面库-swing来开发gui应用程序,awt是图形用户界面编程的基础,它的布局管理、事件机制、剪贴板操作等内容仍然适用于swing gui编程.
Java编程入门篇三
java编程心得
计算机3班
窦金霞
20104773
最近几周一直在弄程序,说实话真的很累,但累中也有成功的快乐。我觉得学到了很多东西,这是只看课本知识所不能学到的。
说实话,以前我一直没学过java虽然我也知道java的重要性,可是即使上课听了,不实践还是掌握不了。因为种种原因,今年我没有买笔记本。没有机器,仅仅靠每周一次的上机练习是绝对不够的。所以我就插空调程序,在舍友们不用的时候自己再接她们的电脑调。
调上一个web版的通讯录程序时我已经感觉到学的很吃力,好多东西都不懂。这次做的这个学生成绩管理系统更复杂了,所以一开始调的时候感觉特别吃力.所以我告诉自己不能放弃,慢慢来,就这样我从最基本的sql语句session对象开始学起,我觉得我还有太多不懂得所以要比别人付出更多的努力。就这样我一点一点的学着„„
说心里话,在做上一个web版的通讯录时,我就感觉到成功的喜悦。好多地方我都是一点一点的问的,在问的过程中,我也学会了很多,像:servlet和jsp之间跳不过去时有两种解决办法,;二是将servlet中的throws exception改成try catch以捕捉异常;我还学到了集中查找错误的方法,可以加上两个双斜杠“//”将具体的方法屏蔽掉,一检查是方法错误还是servlet错误,n()将获得的数据输出,用来检查数据传输过程有没有错误等等。
虽然在别人看来,这些方法可能都很常规,但是确实我自己学会的,我觉得很有成就感。我已经做好计划了,暑假的时候去买本本用自己的本本练习一下java,虽然下学期不学java了,但是我对java的热情不会因为这个而削减的!
做完这个学生成绩管理系统后,我觉得我对java的看法已经改变了。一前总以为java很繁琐很难,听同学说java不好学,开始又有一些听不懂,所以一直很畏惧java。但真正做了这个系统以后我才感觉到其实任何事都没有难与不难之分,只要你肯努力的去做,世上无难事只怕有心人!
我现在对java学习充满了热情,我知道我还有很多的不足
还有很多需要努力的地方,所以我的java之旅将继续进行„„
Java编程入门篇四
in the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:
class test {
static void main(string args []){
ee e = new employee(“bob”, 48);
atepay();
n(etails());
6.e = null;
7.e = new employee(“denise”, 36);
atepay();
n(etails());
10.}
11.}
only one:
in the following code, which is the earliest statement, where the object originally held in e, may be garbage collected:
class test {
static void main(string args []){
ee e = new employee(“bob”, 48);
atepay();
n(etails());
6.e = null;
7.e = new employee(“denise”, 36);
atepay();
n(etails());
10.}
11.}
only one:
10
11
7
8
2:exhibit :
class test(e static int j = 0;
e static boolean methodb(int k)(5.j += k;
true;
6.)
static void methoda(int i){
n b:
10.b = i < 10 | methodb(4);
11.b = i < 10 || methodb(8);
12.)
static void main(string args[] }(a(0);
n(j);
17.)
18.)
what is the result?
program prints “0”
program prints “4”
program prints “8”
program prints “12”
3:what is written to the standard output given the following statement:n(4|7);
select the right answer:
a.4
b.5
c.6
d.7
4:
select valid identifier of java:
select valid identifier of java:
a.%passwd
b.3d_game
c.$charge
5:设有变量说明语句int a=1,b=0;
则执行以下程序段的输出结果为()。
switch(a)
{
case 1:
switch(b)
{
case 0:printf(“**0**”);break;
case 1:printf(“**1**”);break;
}
case 2:printf(“**2**”);break;
}
printf(“ ”);
a.**0**
b.**0****2**
c.**0****1****2**
d.有语法错误
6:in the following pieces of code, which one will compile without any error?
buffer sb1 = “abcd”;
n b = new boolean(“abcd”);
c.c: byte b = 255;
fl = 1.2;
7:
what is the result when you compile and run the following code?
public class throwsdemo
{
static void throwmethod()
{
n(“inside throwmethod.”);
throw new illegalaccessexception(“demo”);
}
public static void main(string args[])
{
try
{
throwmethod();
}
catch(illegalaccessexception e)
{
n(“caught ” + e);
}
}
}
choices:
what is the result when you compile and run the following code?
public class throwsdemo
{
static void throwmethod()
{
n(“inside throwmethod.”);
throw new illegalaccessexception(“demo”);
}
public static void main(string args[])
{
try
{
throwmethod();
}
catch(illegalaccessexception e)
{
n(“caught ” + e);
}
}
}
choices:
ation error
e error
e successfully, nothing is ed by caught:laccessexcption: demo
8:which of the following statements are not legal?
l = 4990;
i = 4l;
d = 34.4;
t = 0.9f.9:
give the following java class:
public class example{
public static void main(string args[]){
static int x[] = new int[15];
n(x[5]);
}
}
which statement is corrected?
give the following java class:
public class example{
public static void main(string args[]){
static int x[] = new int[15];
n(x[5]);
}
}
which statement is corrected?
compile, some error will run, some error will is is null.10:下面关于变量及其范围的陈述哪些是错的。
a.实例变量是类的成员变量。
b.实例变量用关键字static声明。
c.在方法中定义的局部变量在该方法被执行时创建
d.局部变量在使用前必须被初始化。
11:
public class x{
public object m(){
object o = new float(3.14f);//line 3
object [] oa = new object[1];//line 4
oa[0] = o;//line 5
o=null;//line 6
return oa[0];//line 7
}
}
when is the float object, created in line 3,eligible for garbage collection?
public class x{
public object m(){
object o = new float(3.14f);//line 3
object [] oa = new object[1];//line 4
oa[0] = o;//line 5
o=null;//line 6
return oa[0];//line 7
}
}
when is the float object, created in line 3,eligible for garbage collection?
after line after line 6
after line 7(that is,as the method returns)
in this method
12:
which is the most appropriate code snippet that can be inserted at line 18 in the following code?
(assume that the code is compiled and run with assertions enabled)
.*;
class asserttest
4.{
e hashmap cctld;
asserttest()
8.{
= new hashmap();
(“in”, “india”);
(“uk”, “united kingdom”);
(“au”, “australia”);
13.// more code...14.}
15.// other methods.... string getcountry(string countrycode)
17.{
18.// what should be inserted here?
country =(string)(countrycode);
country;
21.}
22.}
which is the most appropriate code snippet that can be inserted at line 18 in the following code?
(assume that the code is compiled and run with assertions enabled)
.*;
class asserttest
4.{
e hashmap cctld;
asserttest()
8.{
= new hashmap();
(“in”, “india”);
(“uk”, “united kingdom”);
(“au”, “australia”);
13.// more code...14.}
15.// other methods.... string getcountry(string countrycode)
17.{
18.// what should be inserted here?
country =(string)(countrycode);
country;
21.}
22.}
countrycode!= null;
countrycode!= null : “country code can not be null”;
cctld!= null : “no country code data is available”;
cctld : “no country code data is available”;
13:
give the following code:
public class example{
public static void main(string args[]){
int l=0;
do{
n(“doing it for l is:”+l);
}while(—l>0)
n(“finish”);
}
}
which well be output:
give the following code:
public class example{
public static void main(string args[]){
int l=0;
do{
n(“doing it for l is:”+l);
}while(—l>0)
n(“finish”);
}
}
which well be output:
it for l is 3
it for l is 1
it for l is 2
it for l is 0
14:which statements about java code security are not true?
bytecode verifier loads all classes needed for the execution of a ing code is performed by the runtime runtime the bytecodes are loaded, checked and run in an interpreter. class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.15:a class design requires that a member variable should be accessible only by same package, which modifer word should be used?
ted
modifer
e
16:character流与byte流的区别是
a.每次读入的字节数不同
b.前者带有缓冲,后者没有
c.前者是块读写,后者是字节读写
d.二者没有区别,可以互换使用
简答题
17:找出两个字符串中最大子字符串,如“abractyeyt”,“dgdsaeactyey”的最大子串为“actyet”
18:假设你有一个用1001个整数组成的数组,这些整数是任意排列的,但是你知道所有的整数都在1到1000(包括1000)之间。此外,除一个数字出现两次外,其他所有数字只出现一次。假设你只能对这个数组做一次处理,用一种算法找出重复的那个数字。如果你在运算中使用了辅助的存储方式,那么你能找到不用这种方式的算法吗?
19:到底在哪里使用cascade=“...”?
20:使用tomcat部署应用程序 emoryerror 吗?如何解决的。
21:请写一个java程序实现数据库缓冲池的功能?
22:有200个正整数,且每个数均在1000至9999之间。请编制函数,其函数的功能是:要求按每个数的后三位的大小进行升序排列,然后取出满足此条件的前10个数依次存入数组bb中,如果后三位的数值相等,则按原先的数值进行降序排列。
23:anonymous inner class(匿名内部类)是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
24:找出字符串a中包含的字符可以进行的所有不同组合。例如:abccd中,ab,ac,bc,cc,abd等都是可能的组合。
25:下面的代码在绝大部分时间内都运行得很正常,请问在什么情况下会出现问题?问题的根源在哪里?
import .linkedlist;
public class stack {
linkedlist list = new linkedlist();
public synchronized void push(object x){
synchronized(list){
t(x);
notify();
}
}
public synchronized object pop()
throws exception {
synchronized(list){
if(()<= 0){
wait();
}
return last();
}
}
}
Java编程入门篇五
java编程进阶类书籍
打下一个良好的java基础,还需要更多的实践经验积累,我想没有什么捷径。有两本书值得你在编程生涯的这个阶段阅读,培养良好的编程习惯,提高你的代码质量。
1、《重构 改善既有代码的设计》
这本书名气很大,不用多介绍,可以在闲暇的时候多翻翻,多和自己的实践相互印证。这本书对你产生影响是潜移默化的。
2、《测试驱动开发 by example》
本书最大特点是很薄,看起来没有什么负担。你可以找一个周末的下午,一边看,一边照做,一个下午就把书看完,这本书的所有例子跑完了。这本书的作用是通过实战让你培养tdd的思路。
注:学it首选长沙牛耳软件教育学校,成就人生梦想。
牛耳软件教育成立于2001年,是中国最早专业从事it职业教育的机构之一,也是中国十大品牌it教育机构,湖南省指定“服务外包人才培训基地”,是湖南乃至整个中南地区最大的软件工程师培训基地。
牛耳依托自身丰富的it行业经验,9年来一直致力于为it企业培养和输送高质量、专业化计算机软件开发人才。目前,牛耳已建立起了从软件技能培养、职业素质训练、项目实训到人才输送的一体化服务体系。
牛耳已在长沙-大连两大城市建立三大校区,近30000平米的现代化教学场地,拥有教职队伍近300人,在校学生达4000人。配备现代化液晶电脑机房和专业服务器、多媒体教室、实习机房、项目开发区、案例讨论室、软件评测室、图书室等齐备的教学设施,并建立标准的学生宿舍、食堂、浴室、超市等生活设施。是广大学子理想的求学成才场所。
作为专业的it教育机构,牛耳依托国防科技大学雄厚计算机教育背景,融合国内外优秀it职业教育的成功经验,研发了拥有自主知识产权的课程体系。依照cmmi3质量管理体系来开展it职业教育的教学工作,统一品牌、统一课程体系和标准课件,实现标准化的项目实习案例。
9年来,牛耳软件教育的发展目标始终定位在培养专业化、职业化的软件人才,始终坚持“对学生负责、对家长负责、对企业负责、对社会负责”的办学理
念。牛耳软件教育提倡 “学历+技能”的新型教育模式,凭借先进的教学理念、国际化的产业视野、自主的课程研发体系、严格的标准化管理体系,为中国it产业培养了8000余名软件专业技术人才,学生以扎实的技术功底和良好的职业素质,得到各用人企业的高度认可。
热忱欢迎广大学子来我校就读,为自己创造美好的未来!

一键复制