网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

java代码经典,java常用代码

给段最简单的java代码 让我新手看一下

最简单的java代码肯定就是这个了,如下:

因为努力和真诚,有更多的客户和我们聚集在一起,为了共同目标,成都创新互联公司在工作上密切配合,从创业型企业到如今不断成长,要感谢客户对我们的高要求,让我们敢于面对挑战,才有今天的进步与发展。从网站到微信小程序定制开发,软件开发,成都App定制开发,十多年企业网站建设服务经验,为企业提供网站设计,网站改版维护一条龙服务.为企业提供网络营销推广,定制网站制作,原创设计,十多年品质,值得您的信赖.

public class MyFirstApp

{

public static void main(String[] args)

{

System.out.print("Hello world");

}

}

“hello world”就是应该是所有学java的新手看的第一个代码了。如果是零基础的新手朋友们可以来我们的java实验班试听,有免费的试听课程帮助学习java必备基础知识,有助教老师为零基础的人提供个人学习方案,学习完成后有考评团进行专业测试,帮助测评学员是否适合继续学习java,15天内免费帮助来报名体验实验班的新手快速入门java,更好的学习java!

java冒泡排序法代码

冒泡排序是比较经典的排序算法。代码如下:

for(int i=1;iarr.length;i++){

for(int j=1;jarr.length-i;j++){

//交换位置

}    

拓展资料:

原理:比较两个相邻的元素,将值大的元素交换至右端。

思路:依次比较相邻的两个数,将小数放在前面,大数放在后面。即在第一趟:首先比较第1个和第2个数,将小数放前,大数放后。然后比较第2个数和第3个数,将小数放前,大数放后,如此继续,直至比较最后两个数,将小数放前,大数放后。重复第一趟步骤,直至全部排序完成。

第一趟比较完成后,最后一个数一定是数组中最大的一个数,所以第二趟比较的时候最后一个数不参与比较;

第二趟比较完成后,倒数第二个数也一定是数组中第二大的数,所以第三趟比较的时候最后两个数不参与比较;

依次类推,每一趟比较次数-1;

??

举例说明:要排序数组:int[] arr={6,3,8,2,9,1}; 

for(int i=1;iarr.length;i++){

for(int j=1;jarr.length-i;j++){

//交换位置

}    

参考资料:冒泡排序原理

有什么io方面的java经典代码

package IO;

import java.io.*;

public class FileDirectoryDemo {

public static void main(String[] args) {

// 如果没有指定参数,则缺省为当前目录。

if (args.length == 0) {

args = new String[] { "." };

}

try {

// 新建指定目录的File对象。

File currentPath = new File(args[0]);

// 在指定目录新建temp目录的File对象。

File tempPath = new File(currentPath, "temp");

// 用“tempPath”对象在指定目录下创建temp目录。

tempPath.mkdir();

// 在temp目录下创建两个文件。

File temp1 = new File(tempPath, "temp1.txt");

temp1.createNewFile();

File temp2 = new File(tempPath, "temp2.txt");

temp2.createNewFile();

// 递归显示指定目录的内容。

System.out.println("显示指定目录的内容");

listSubDir(currentPath);

// 更改文件名“temp1.txt”为“temp.txt”。

File temp1new = new File(tempPath, "temp.txt");

temp1.renameTo(temp1new);

// 递归显示temp子目录的内容。

System.out.println("更改文件名后,显示temp子目录的内容");

listSubDir(tempPath);

// 删除文件“temp2.txt”。

temp2.delete();

// 递归显示temp子目录的内容。

System.out.println("删除文件后,显示temp子目录的内容");

listSubDir(tempPath);

} catch (IOException e) {

System.err.println("IOException");

}

}

// 递归显示指定目录的内容。

static void listSubDir(File currentPath) {

// 取得指定目录的内容列表。

String[] fileNames = currentPath.list();

try {

for (int i = 0; i fileNames.length; i++) {

File f = new File(currentPath.getPath(), fileNames[i]);

// 如果是目录,则显示目录名后,递归调用,显示子目录的内容。

if (f.isDirectory()) {

// 以规范的路径格式显示目录。

System.out.println(f.getCanonicalPath());

// 递归调用,显示子目录。

listSubDir(f);

}

// 如果是文件,则显示文件名,不包含路径信息。

else {

System.out.println(f.getName());

}

}

} catch (IOException e) {

System.err.println("IOException");

}

}

}

package IO;

import java.io.*;

public class FileExample {

public FileExample() {

super();

}

public static void main(String[] args) {

try {

String outfile = "demoout.xml";

String infile = "demoin.xml";

/**

* 用FileOutputStream定义一个输入流文件,然后用BuferedOutputStream调用FileOutputStream对象生成一个缓冲输出流

然后用DataOutputStream调用BuferedOutputStream对象生成数据格式化输出流

*/

DataOutputStream dt=new DataOutputStream(new BufferedOutputStream(new FileOutputStream(outfile)));

BufferedWriter NewFile = new BufferedWriter(new OutputStreamWriter(dt, "GBK"));

// 对中文的处理

// 定义一个输入流

DataInputStream rafFile1 = new DataInputStream(new BufferedInputStream(new FileInputStream(infile)));

// 定义一个输入缓冲

BufferedReader rafFile = new BufferedReader(new InputStreamReader(rafFile1, "GBK"));

String xmlcontent = "";

char tag = 0;// 文件友字符0结束

while (tag != (char) (-1)) {

xmlcontent = xmlcontent + tag + rafFile.readLine() + '\n';

tag = (char) rafFile.read();

}

NewFile.write(xmlcontent);

NewFile.flush();

NewFile.close();

rafFile.close();

System.gc();

} catch (NullPointerException exc) {

exc.printStackTrace();

} catch (java.lang.IndexOutOfBoundsException outb) {

System.out.println(outb.getMessage());

outb.printStackTrace();

} catch (FileNotFoundException fex) {

System.out.println("fex" + fex.getMessage());

} catch (IOException iex) {

System.out.println("iex" + iex.getMessage());

}

}

}

package IO;

import java.io.*;

public class FileRandomRW {

// 需要输入的person数目。

public static int NUMBER = 3;

public static void main(String[] args) {

Persons[] people = new Persons[NUMBER];

people[0] = new Persons("张峰", 26, 2000, "N");

people[1] = new Persons("艳娜", 25, 50000, "Y");

people[2] = new Persons("李朋", 50, 7000, "F");

try {

DataOutputStream out = new DataOutputStream(new FileOutputStream(

"peoplerandom.dat"));

// 将人员数据保存至“peoplerandom.dat”二进制文件中。

writeData(people, out);

// 关闭流。

out.close();

// 从二进制文件“peoplerandom.dat”中逆序读取数据。

RandomAccessFile inOut = new RandomAccessFile("peoplerandom.dat",

"rw");

Persons[] inPeople = readDataReverse(inOut);

// 输出读入的数据。

System.out.println("原始数据:");

for (int i = 0; i inPeople.length; i++) {

System.out.println(inPeople[i]);

}

// 修改文件的第三条记录。

inPeople[2].setSalary(4500);

// 将修改结果写入文件。

inPeople[2].writeData(inOut, 3);

// 关闭流。

inOut.close();

// 从文件中读入的第三条记录,并输出,以验证修改结果。

RandomAccessFile in = new RandomAccessFile("peoplerandom.dat", "r");

Persons in3People = new Persons();

// 随机读第三条记录。

in3People.readData(in, 3);

// 关闭流。

in.close();

System.out.println("修改后的记录");

System.out.println(in3People);

} catch (IOException exception) {

System.err.println("IOException");

}

}

// 将数据写入输出流。

static void writeData(Persons[] p, DataOutputStream out) throws IOException {

for (int i = 0; i p.length; i++) {

p[i].writeData(out);

}

}

// 将数据从输入流中逆序读出。

static Persons[] readDataReverse(RandomAccessFile in) throws IOException {

// 获得记录数目。

int record_num = (int) (in.length() / Persons.RECORD_LENGTH);

Persons[] p = new Persons[record_num];

// 逆序读取。

for (int i = record_num - 1; i = 0; i--) {

p[i] = new Persons();

// 文件定位。

in.seek(i * Persons.RECORD_LENGTH);

p[i].readData(in, i + 1);

}

return p;

}

}

class Persons {

private String name;

private int age; // 4个字节

private double salary; // 8个字节

private String married;

public static final int NAME_LENGTH = 20; // 姓名长度

public static final int MARRIED_LENGTH = 2; // 婚否长度

public static final int RECORD_LENGTH = NAME_LENGTH * 2 + 4 + 8

+ MARRIED_LENGTH * 2;

public Persons() {

}

public Persons(String n, int a, double s) {

name = n;

age = a;

salary = s;

married = "F";

}

public Persons(String n, int a, double s, String m) {

name = n;

age = a;

salary = s;

married = m;

}

public String getName() {

return name;

}

public int getAge() {

return age;

}

public double getSalary() {

return salary;

}

public String getMarried() {

return married;

}

public String setName(String n) {

name = n;

return name;

}

public int setAge(int a) {

age = a;

return age;

}

public double setSalary(double s) {

salary = s;

return salary;

}

public String setMarried(String m) {

married = m;

return married;

}

// 设置输出格式。

public String toString() {

return getClass().getName() + "[name=" + name + ",age=" + age

+ ",salary=" + salary + ",married=" + married + "]";

}

// 写入一条固定长度的记录,即一个人的数据到输出流。

public void writeData(DataOutput out) throws IOException {

FixStringIO.writeFixString(name, NAME_LENGTH, out);

out.writeInt(age);

out.writeDouble(salary);

FixStringIO.writeFixString(married, MARRIED_LENGTH, out);

}

// 写入一条固定长度的记录到随机读取文件中。

private void writeData(RandomAccessFile out) throws IOException {

FixStringIO.writeFixString(name, NAME_LENGTH, out);

out.writeInt(age);

out.writeDouble(salary);

FixStringIO.writeFixString(married, MARRIED_LENGTH, out);

}

// 随机写入一条固定长度的记录到输出流的指定位置。

public void writeData(RandomAccessFile out, int n) throws IOException {

out.seek((n - 1) * RECORD_LENGTH);

writeData(out);

}

// 从输入流随机读入一条记录,即一个人的数据。

private void readData(RandomAccessFile in) throws IOException {

name = FixStringIO.readFixString(NAME_LENGTH, in);

age = in.readInt();

salary = in.readDouble();

married = FixStringIO.readFixString(MARRIED_LENGTH, in);

}

// 从输入流随机读入指定位置的记录。

public void readData(RandomAccessFile in, int n) throws IOException {

in.seek((n - 1) * RECORD_LENGTH);

readData(in);

}

}

// 对固定长度字符串从文件读出、写入文件

class FixStringIO {

// 读取固定长度的Unicode字符串。

public static String readFixString(int size, DataInput in)

throws IOException {

StringBuffer b = new StringBuffer(size);

int i = 0;

boolean more = true;

while (more i size) {

char ch = in.readChar();

i++;

if (ch == 0) {

more = false;

} else {

b.append(ch);

}

}

// 跳过剩余的字节。

in.skipBytes(2 * (size - i));

return b.toString();

}

// 写入固定长度的Unicode字符串。

public static void writeFixString(String s, int size, DataOutput out)

throws IOException {

int i;

for (i = 0; i size; i++) {

char ch = 0;

if (i s.length()) {

ch = s.charAt(i);

}

out.writeChar(ch);

}

}

}

package IO;

import java.io.*;

import java.util.*;

public class FileRW {

// 需要输入的person数目。

public static int NUMBER = 3;

public static void main(String[] args) {

Person[] people = new Person[NUMBER];

// 暂时容纳输入数据的临时字符串数组。

String[] field = new String[4];

// 初始化field数组。

for (int i = 0; i 4; i++) {

field[i] = "";

}

// IO操作必须捕获IO异常。

try {

// 用于对field数组进行增加控制。

int fieldcount = 0;

// 先使用System.in构造InputStreamReader,再构造BufferedReader。

BufferedReader stdin = new BufferedReader(new InputStreamReader(

System.in));

for (int i = 0; i NUMBER; i++) {

fieldcount = 0;

System.out.println("The number " + (i + 1) + " person");

System.out

.println("Enter name,age,salary,married(optional),please separate fields by ':'");

// 读取一行。

String personstr = stdin.readLine();

// 设置分隔符。

StringTokenizer st = new StringTokenizer(personstr, ":");

// 判断是否还有分隔符可用。

while (st.hasMoreTokens()) {

field[fieldcount] = st.nextToken();

fieldcount++;

}

// 如果输入married,则field[3]不为空,调用具有四个参数的Person构造函数。

if (field[3] != "") {

people[i] = new Person(field[0],

Integer.parseInt(field[1]), Double

.parseDouble(field[2]), field[3]);

// 置field[3]为空,以备下次输入使用。

field[3] = "";

}

// 如果未输入married,则field[3]为空,调用具有三个参数的Person构造函数。

else {

people[i] = new Person(field[0],

Integer.parseInt(field[1]), Double

.parseDouble(field[2]));

}

}

// 将输入的数据保存至“people.dat”文本文件中。

PrintWriter out = new PrintWriter(new BufferedWriter(

new FileWriter("people.dat")));

writeData(people, out);

// 关闭流。

out.close();

// 从文件“people.dat”读取数据。

BufferedReader in = new BufferedReader(new FileReader("people.dat"));

Person[] inPeople = readData(in);

// 关闭流。

in.close();

// 输出从文件中读入的数据。

for (int i = 0; i inPeople.length; i++) {

System.out.println(inPeople[i]);

}

} catch (IOException exception) {

System.err.println("IOException");

}

}

// 将所有数据写入输出流。

static void writeData(Person[] p, PrintWriter out) throws IOException {

// 写入记录条数,即人数。

out.println(p.length);

for (int i = 0; i p.length; i++) {

p[i].writeData(out);

}

}

// 将所有数据从输入流中读出。

static Person[] readData(BufferedReader in) throws IOException {

// 获取记录条数,即人数。

int n = Integer.parseInt(in.readLine());

Person[] p = new Person[n];

for (int i = 0; i n; i++) {

p[i] = new Person();

p[i].readData(in);

}

return p;

}

}

class Person {

private String name;

private int age;

private double salary;

private String married;

public Person() {

}

public Person(String n, int a, double s) {

name = n;

age = a;

salary = s;

married = "F";

}

public Person(String n, int a, double s, String m) {

name = n;

age = a;

salary = s;

married = m;

}

public String getName() {

return name;

}

public int getAge() {

return age;

}

public double getSalary() {

return salary;

}

public String getMarried() {

return married;

}

// 设置输出格式。

public String toString() {

return getClass().getName() + "[name=" + name + ",age=" + age

+ ",salary=" + salary + ",married=" + married + "]";

}

// 写入一条记录,即一个人的数据到输出流。

public void writeData(PrintWriter out) throws IOException {

// 格式化输出。

out.println(name + ":" + age + ":" + salary + ":" + married);

}

// 从输入流读入一条记录,即一个人的数据。

public void readData(BufferedReader in) throws IOException {

String s = in.readLine();

StringTokenizer t = new StringTokenizer(s, ":");

name = t.nextToken();

age = Integer.parseInt(t.nextToken());

salary = Double.parseDouble(t.nextToken());

married = t.nextToken();

}

}

package IO;

import java.io.*;

public class IOStreamExample {

public static void main(String[] args) throws IOException {

// 1. 读入一行数据:

BufferedReader in = new BufferedReader(new FileReader(

"FileStdRead.java"));

String s, s2 = new String();

while ((s = in.readLine()) != null) {

s2 += s + "\n";

}

in.close();

BufferedReader stdin = new BufferedReader(new InputStreamReader(

System.in));

System.out.print("Enter a line:");

System.out.println(stdin.readLine());

// 2. 从内存中读入

StringReader in2 = new StringReader(s2);

int c;

while ((c = in2.read()) != -1) {

System.out.print((char) c);

}

// 3. 格式化内存输入

try {

DataInputStream in3 = new DataInputStream(new ByteArrayInputStream(

s2.getBytes()));

while (true) {

System.out.print((char) in3.readByte());

}

} catch (EOFException e) {

System.err.println("End of stream");

}

// 4. 文件输入

try {

BufferedReader in4 = new BufferedReader(new StringReader(s2));

PrintWriter out1 = new PrintWriter(new BufferedWriter(

new FileWriter("IODemo.out")));

int lineCount = 1;

while ((s = in4.readLine()) != null) {

out1.println(lineCount++ + ": " + s);

}

out1.close();

} catch (EOFException e) {

System.err.println("End of stream");

}

// 5. 接收和保存数据

try {

DataOutputStream out2 = new DataOutputStream(

new BufferedOutputStream(new FileOutputStream("Data.txt")));

out2.writeDouble(3.14159);

out2.writeUTF("That was pi");

out2.writeDouble(1.41413);

out2.writeUTF("Square root of 2");

out2.close();

DataInputStream in5 = new DataInputStream(new BufferedInputStream(

new FileInputStream("Data.txt")));

System.out.println(in5.readDouble());

System.out.println(in5.readUTF());

System.out.println(in5.readDouble());

System.out.println(in5.readUTF());

} catch (EOFException e) {

throw new RuntimeException(e);

}

// 6. 随机读取文件内容

RandomAccessFile rf = new RandomAccessFile("rtest.dat", "rw");

for (int i = 0; i 10; i++) {

rf.writeDouble(i * 1.414);

}

rf.close();

rf = new RandomAccessFile("rtest.dat", "rw");

rf.seek(5 * 8);

rf.writeDouble(47.0001);

rf.close();

rf = new RandomAccessFile("rtest.dat", "r");

for (int i = 0; i 10; i++) {

System.out.println("Value " + i + ": " + rf.readDouble());

}

rf.close();

}

}

package IO;

import java.io.*;

/**

* p

* Title: JAVA进阶诀窍

* /p

*

* @author 张峰

* @version 1.0

*/

public class MakeDirectoriesExample {

private static void fileattrib(File f) {

System.out.println("绝对路径: " + f.getAbsolutePath() + "\n 可读属性: "

+ f.canRead() + "\n 可定属性: " + f.canWrite() + "\n 文件名: "

+ f.getName() + "\n 父目录: " + f.getParent() + "\n 当前路径: "

+ f.getPath() + "\n 文件长度: " + f.length() + "\n 最后更新日期: "

+ f.lastModified());

if (f.isFile()) {

System.out.println("输入的是一个文件");

} else if (f.isDirectory()) {

System.out.println("输入的是一个目录");

}

}

public static void main(String[] args) {

if (args.length 1) {

args = new String[3];

}

args[0] = "d";

args[1] = "test1.txt";

args[2] = "test2.txt";

File old = new File(args[1]), rname = new File(args[2]);

old.renameTo(rname);

fileattrib(old);

fileattrib(rname);

int count = 0;

boolean del = false;

if (args[0].equals("d")) {

count++;

del = true;

}

count--;

while (++count args.length) {

File f = new File(args[count]);

if (f.exists()) {

System.out.println(f + " 文件己经存在");

if (del) {

System.out.println("删除文件" + f);

f.delete();

}

} else { // 如果文件不存在

if (!del) {

f.mkdirs();

System.out.println("创建文件: " + f);

}

}

fileattrib(f);

}

}

}

java线程的经典代码

package threadgroup;

class ThreadDemo3 extends Thread {

private String name;

private int delay;

public ThreadDemo3(String sname, int i_delay) {

name = sname;

delay = i_delay;

}

public void run() {

try {

sleep(delay);

} catch (InterruptedException e) {

}

System.out.println("多线程测试!\n" + name + "\n" + delay);

}

}

public class testMyThread {

public static void main(String[] args) {

ThreadDemo3 th1,th2,th3;

th1 = new ThreadDemo3("线程1", (int) (Math.random() * 900));

th2 = new ThreadDemo3("线程2", (int) (Math.random() * 900));

th3 = new ThreadDemo3("线程3", (int) (Math.random() * 900));

th1.start();

th2.start();

th3.start();

}

}

package threadgroup;

public class threadDemo {

public static void main(String[] args) {

Thread t = Thread.currentThread();

t.setName("你好吗?");

System.out.println("正在进行的Thread是:" + t);

try {

for (int i = 0; i 5; i++) {

System.out.println("我不叫穆继超" + i);

Thread.sleep(3000);

}

} catch (Exception e) {

// TODO: handle exception

System.out.println("Thread has wrong" + e.getMessage());

}

}

}

package threadgroup;

public class threadDemo2 implements Runnable {

public threadDemo2() {

Thread t1 = Thread.currentThread();

t1.setName("第一个主进程");

System.out.println("正在运行" + t1);

Thread t2 = new Thread(this, "");

System.out.println("在创建一个进程");

t2.start();

try {

System.out.println("使他进入第一个睡眠状态");

Thread.sleep(2000);

} catch (InterruptedException e) {

System.out.println("Thread has wrong" + e.getMessage());

}

System.out.println("退出第一个进程");

}

public void run() {

try {

for (int i = 0; i 5; i++) {

System.out.println("进程" + i);

Thread.sleep(3000);

}

} catch (InterruptedException e) {

// TODO: handle exception

System.out.println("Thread has wrong" + e.getMessage());

}

System.out.println("退出第二个进程");

}

public static void main(String[] args) {

new threadDemo2();

}

}

java的经典书籍有哪些呀?

一、Java编程入门类

对于没有Java编程经验的程序员要入门,随便读什么入门书籍都一样,这个阶段需要你快速的掌握Java基础语法和基本用法,宗旨就是“囫囵吞枣不求甚解”,先对Java熟悉起来再说。用很短的时间快速过一遍Java语法,连懵带猜多写写代码,要“知其然”。

1、《Java编程思想》

在有了一定的Java编程经验之后,你需要“知其所以然”了。这个时候《Java编程思想》是一本让你知其所以然的好书,它对于基本的面向对象知识有比较清楚的交待,对Java基本语法,基本类库有比较清楚的讲解,可以帮你打一个良好的Java编程基础。这本书的缺点是实在太厚,也比较罗嗦,不适合现代人快节奏学习,因此看这本书要懂得取舍,不是每章每节都值得一看的,挑重点的深入看就可以了。

2、《Agile Java》中文版

这本书是出版社送给我的,我一拿到就束之高阁,放在书柜一页都没有翻过,但是前两天整理书柜的时候,拿出来一翻,竟然发现这绝对是一本好书!这本书一大特点是以单元测试和TDD来贯穿全书的,在教你Java各种重要的基础知识的过程中,潜移默化的影响你的编程思维走向敏捷,走向TDD。另外这本书成书很新,以JDK5.0的语法为基础讲解,要学习JDK5.0的新语法也不错。还有这本书对于内容取舍也非常得当,Java语言毕竟类库庞大,可以讲的内容太多,这本书选择的内容以及内容的多寡都很得当,可以让你以最少的时间掌握Java最重要的知识,顺便培养出来优秀的编程思路,真是一本不可多得的好书。 虽然作者自己把这本书定位在入门级别,但我不确定这本书用来入门是不是稍微深了点,我自己也准备有空的时候翻翻这本书,学习学习。

二、Java编程进阶类

打下一个良好的Java基础,还需要更多的实践经验积累,我想没有什么捷径。有两本书值得你在编程生涯的这个阶段阅读,培养良好的编程习惯,提高你的代码质量。

1、《重构 改善既有代码的设计》

这本书名气很大,不用多介绍,可以在闲暇的时候多翻翻,多和自己的实践相互印证。这本书对你产生影响是潜移默化的。

2、《测试驱动开发 by Example》

本书最大特点是很薄,看起来没有什么负担。你可以找一个周末的下午,一边看,一边照做,一个下午就把书看完,这本书的所有例子跑完了。这本书的作用是通过实战让你培养TDD的思路。

三、Java架构师之路

到这个阶段,你应该已经非常娴熟的运用Java编程,而且有了一个良好的编程思路和习惯了,但是你可能还缺乏对应用软件整体架构的把握,现在就是你迈向架构师的第一步。

1、《Expert One-on-One J2EE Design and Development》

这本书是Rod Johnson的成名著作,非常经典,从这本书中的代码诞生了springframework。但是好像这本书没有中译本。

2、《Expert One-on-One J2EE Development without EJB》

这本书由gigix组织翻译,多位业界专家参与,虽然署名译者是JavaEye,其实JavaEye出力不多,实在是忝居译者之名。

以上两本书都是Rod Johnson的经典名著,Java架构师的必读书籍。在我所推荐的这些书籍当中,是我看过的最仔细,最认真的书,我当时读这本书几乎是废寝忘食的一气读完的,有小时候挑灯夜读金庸武侠小说的劲头,书中所讲内容和自己的经验知识一一印证,又被无比精辟的总结出来,读完这本书以后,我有种被打通经脉,功力爆增的感觉。

但是后来我看过一些其他人的评价,似乎阅读体验并没有我那么high,也许是因为每个人的知识积累和经验不同导致的。我那个时候刚好是经验知识积累已经足够丰富,但是还没有系统的整理成型,让这本书一梳理,立刻形成完整的知识体系了。

3、《企业应用架构模式》

Martin的又一本名著,但这本书我只是泛泛的看了一遍,并没有仔细看。这本书似乎更适合做框架的人去看,例如如果你打算自己写一个ORM的话,这本书是一定要看的。但是做应用的人,不看貌似也无所谓,但是如果有空,我还是推荐认真看看,会让你知道框架为什么要这样设计,这样你的层次可以晋升到框架设计者的角度去思考问题。Martin的书我向来都是推崇,但是从来都没有像Rod Johnson的书那样非常认真去看。

4、《敏捷软件开发 原则、模式与实践》

Uncle Bob的名著,敏捷的经典名著,这本书比较特别,与其说是讲软件开发过程的书,不如说讲软件架构的书,本书用了很大篇幅讲各种面向对象软件开发的各种模式,个人以为看了这本书,就不必看GoF的《设计模式》了。

四、软件开发过程

了解软件开发过程不单纯是提高程序员个人的良好编程习惯,也是增强团队协作的基础。

1、《UML精粹》

UML其实和软件开发过程没有什么必然联系,却是软件团队协作沟通,撰写软件文档需要的工具。但是UML真正实用的图不多,看看这本书已经足够了,完全没有必要去啃《UML用户指南》之类的东西。要提醒大家的是,这本书的中译本翻译的非常之烂,建议有条件的看英文原版。

2、《解析极限编程 拥抱变化》XP

这是Kent Beck名著的第二版,中英文对照。没什么好说的,必读书籍。

3、《统一软件开发过程》UP

其实UP和敏捷并不一定冲突,UP也非常强调迭代,测试,但是UP强调的文档和过程驱动却是敏捷所不取的。不管怎么说,UP值得你去读,毕竟在中国真正接受敏捷的企业很少,你还是需要用UP来武装一下自己的,哪怕是披着UP的XP。

4、《敏捷建模》AM

Scott Ambler的名著,这本书非常的progmatic,告诉你怎么既敏捷又UP,把敏捷和UP统一起来了,又提出了很多progmatic的建议和做法。你可以把《解析极限编程 拥抱变化》、《统一软件开发过程》和《敏捷建模》这三本书放在一起读,看XP和UP的不同点,再看AM是怎么统一XP和UP的,把这三种理论融为一炉,形成自己的理论体系,那么你也可以去写书了。

五、软件项目管理

如果你突然被领导提拔为项目经理,而你完全没有项目管理经验,你肯定会心里没底;如果你觉得自己管理项目不善,很想改善你的项目管理能力,那么去考PMP肯定是远水不解近渴的。

1、《快速软件开发》

这也是一本名著。可以这样说,有本书在手,你就有了一个项目管理的高级参谋给你出谋划策,再也不必担心自己不能胜任的问题了。这本书不是讲管理的理论的,在实际的项目管理中,讲这些理论是不解决问题的,这本书有点类似于“软件项目点子大全”之类的东西,列举了种种软件项目当中面临的各种问题,以及应该如何解决问题的点子,你只需要稍加变通,找方抓药就行了。

六、总结

在这份推荐阅读书籍的名单中,我没有列举流行的软件框架类学习书籍,例如Struts,Hibernate,Spring之类,也没有列举AJAX方面的书籍。是因为这类书籍容易过时,而上述的大半书籍的生命周期都足够长,值得你去购买和收藏。

希望对您有所帮助!~


分享标题:java代码经典,java常用代码
文章起源:http://bjjierui.cn/article/hsojgg.html

其他资讯