随笔分类 - java+
摘要:1 public class Main 2 { 3 public static void main(String[] args) 4 { 5 Itest testA=Factory.creator(1); 6 Itest testB=Factory.creator(2); 7 } 8 } 1 public class Factory ...
阅读全文
摘要:1 public class Window 2 { 3 public static void main(String[] args) 4 { 5 JFrame f=new JFrame(); 6 f.setSize(500, 300); 7 Dimension window_size = Toolkit.getDefaultTool...
阅读全文
摘要:1 package test1; 2 3 public class Test1 4 { 5 public static void main(String[] args) 6 { 7 //把一个特定字符串转换成int类型 8 String intStr="123"; 9 int it1=Integer.pars...
阅读全文
摘要:1 public class Test 2 { 3 4 public static void main(String[] args) 5 { 6 for(int i=0;i<10;i++) 7 { 8 if(i==5) 9 { 10 contin...
阅读全文
摘要:package test; public class Test { public void A() { for(int i=0;i<10;i++) { if(i==5) { break; } } } ...
阅读全文
摘要://查找key元素在a数组中的索引数,要求数组中的元素已经按升序排列 Arrays.binarySearch(type[] a,type key); //从fromIndex到toIndex中查找key元素在a数组中的索引数,要求数组中的元素已经按升序排列 Arrays.binarySearch(type[] a,int fromI...
阅读全文
摘要:1 try 2 { 3 } 4 catch (Exception e) 5 { 6 e.printStackTrace(); 7 8 StringWriter sw = new StringWriter(); 9 e.printStackTrace(new PrintWriter(sw, true)); 10 sw.toStr...
阅读全文
摘要:1.打开sh文件添加如下例: #!/bin/sh //配置java的环境变量 export JAVA_HOME=/home/acer/news163/news163_jar/jdk1.8.0_73 export PATH=${JAVA_HOME}/jre/bin:$PATH export JRE_H
阅读全文
摘要:1.执行命令例:jar vcf aaa.jar class包1、包2、包3...... 2.修改Manifest.mf文件变成可执行的jar包 Manifest-Version: 1.0 Created-By: 1.8.0_73 (Oracle Corporation) Main-Class: ne
阅读全文

浙公网安备 33010602011771号