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

Java第二次上机(正则表达式)

编写一个程序,判断一个字符串是否是合法的Java标识符;
//create string
import java.util.regex.*;
public class Split {
public static void main (String[] args) {
Pattern pattern = Pattern.compile("[,]");
String[] arrStr = pattern.split("abstract,break,byte,boolean,catch,case,class,char,continue,default,double,do,else,extends,false,final,float,for,finally,if,import,implements,int,interface,instanceof,long,length,native,new,null,package,private,protected,public,return,switch,synchronized,short,static,super,try,true,this,throw,throws,threadsafe,transient,void,while");
int length = arrStr.length;
for(int i=0; i<length; ++i) {
System.out.print("\"" + arrStr[i] + "\"" + ",");
}
System.out.println();
}
}
import java.util.*;
public class RE {
public static void main (String[] args) {
String[] keyword = new String[] {"abstract","break","byte","boolean","catch","case","class","char","continue","default","double","do","else","extends","false","final","float","for","finally","if","import","implements","int","interface","instanceof","long","length","native","new","null","package","private","protected","public","return","switch","synchronized","short","static","super","try","true","this","throw","throws","threadsafe","transient","void","while"};
Scanner in = new Scanner(System.in);
p("Input String:");
String


相关文档:

Java中奇怪而又无可厚非的类加载顺序

昨天看到这样一篇帖子,讨论类加载顺序的,也可以说是初始化顺序的,今天早上找不到了,本来想回复的,现在自己写博客回复了,呵呵
public class Singleton {   
private static Singleton obj = new Singleton();   
public static int counter1 ;   
public static int counter2 = 0;& ......

Java反编译工具Eclipse插件 Jode Decompiler

Java反编译工具Eclipse插件--Jode Decompiler    
安装非常的简单:
help => Software Updates => Find and Install... => Search for new features to install,
单击"New Remote Site..." 在URL栏输入 http://www.technoetic.com/eclipse/update ,
然后下一步,就可以看到“j ......

java 注释 : annotations 元数据

annotations : 注释
好处
1.文档编制
2.编译器检查
3.代码分析
JSR 175 是编程语言的元数据工具,为将元数据合并到核心java语言中提供正式理由和说明
基本知识:
注释采用"@"标记形式,后面是注释名称,然后在需要数据时,通过name=value对向注释提供数据
注释的三个基本种类:
    标记注释 ......

Java 画线设置粗细、颜色

Graphics2D arg;
float thick=3.0f;
arg1.setStroke(new BasicStroke(thick, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
arg1.drawLine(first.x, first.y, next.x, next.y);
arg1.setColor(Color.red);
......

flex和java做的图片上传的小例子

用的是Commons上传组件,下载地址:Commons
网上找的小例子改的,修改了部分错误。
1,FileUpload.java
package com.fileupload;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.List;
import ja ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号