易截截图软件、单文件、免安装、纯绿色、仅160KB

Java编码规范(The Elements of Java Style)

Genaral Principles 一般约定
1.Adhere to the style
of the original.
保持最初的样式。
2.Adhere to the Principle of Least
Astonishment.
遵守最小惊奇原则。
3.Do it right the first time.

第一次就应当做好。
4.Document any deviations.
对于任何背离都应当文档注释。
Formatting
Conventions 格式约定
5.Indent nested code.
约束嵌套代码。
6.Break up long lines.
拆分长行。
7.Include white space.

包含空格。
8.Do not use "hard" tabs.
不要使用tab键。
Naming
Conventions 命名约定
9.Use meaningful names.
使用有意义的名称。
10.Use familiar names.
使用熟悉的名称。
11.Question excessively
long names.
不要使用过长的名称。
12.Join the vowel generation.

加入元音字母。
13.Capitalize only the first letter in acronyms.

只对简称的第一个字母大写。
14.Do not use names that differ only in case.

不要使用只依赖于大小写来区分的名称。
Package Names  包命名
  15.Use
the reversed, lowercase form of your organization's Internet domain
name as the root qualifier for your package names.
  采用你组织的Internet域名
的反转、小写形式作为包名称的根限定词。
  16.Use a single, lowercase word as the root
name of each package.
  使用一个唯一的小写单词作为每个包的根名称。
  17.Use the
same name for a new version of a package, but only if that new version
is still binary compatible with the previous versin, otherwise, use a
new name.
  只有当包的新版本仍然与旧版本兼容时,对于包的新版本使用相同的名称,否则使用新名称。
  
Type Names 类型命名
  18.Capitalize the first letter of
each word that appears in a class or interface name.
  对于类和接口名称只对每个单词
的第一个字母大写。
  
  Class Names  类命名
   19.Use
nouns when naming classes.
   使用名词来命名类。
  
   20.Pluralize the
names of classes that group related attributes,


相关文档:

Java Set Delete Remove

       // 删除时必须通过iterator.remove()来执行,不能直接使用set的remove()来执行,不然会出现java.util.ConcurrentModificationException异常
/*       Iterator<String> delIter = keySet.iterator();
      ......

巨人网络java笔试基础题分享

1、String是最基本的数据类型吗?
基本数据类型包括byte、int、char、long、float、double、boolean和short。
java.lang.String类是final类型的,因此不可以继承这个类、不能修改这个类。为了提高效率节省空间,我们应该用StringBuffer类
2、int 和 Integer 有什么区别
Java 提供两种不同的类型:引用类型和原始类型( ......

java mysql连接数据库代码

package com.lovo.cq.shopping10_1.common;
import java.sql.*;
public class DbUtil {
private PreparedStatement pstmt = null;
private Connection con = null;
public DbUtil() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://l ......

java生成随机数字和字母组合


注:1.方法的参数 length 是生成的随机数的长度。
      2. 只想要大写的字母 可以使 int choice =65; 只想要小写的字母,就 int choice =97;
import java.util.Random;
public String getCharAndNumr(int length)  
{  
    String val = " ......

Java绘图 如何正确绘图和出现滚动条

面是我认为正确的做法(结合自己的经验写的,如果不正确,请大家指正):
  我的绘图控件是JPanel,
  出现滚动条的前提,必须让绘图控件放在JScrollPane上,
  对于JScrollPane的Layout,没有特殊要求,下面这样即可:
  view plaincopy to clipboardprint?
  jScrollPane1.setViewportView(jPanel1);
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号