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

java中的foreach用法

 import java.util.*;
public class ForeachExample {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r = new Random();
int[] x = new int[10];
for (int i = 0; i < x.length; i++) {
x[i] = r.nextInt(100);
}
// foreach的使用
for (int y : x) {
System.out.print(y + " ");
}
System.out.println();
// 另一种打印数组的方式
System.out.println(Arrays.toString(x));
for (char c : "I am a good girl!".toCharArray())
System.out.print(c + " ");
}



相关文档:

JAVA静态块和非静态块的区别

 
//静态块(static block):如下所示
public class StaticBlock1
{
       static
       {
              System.out.println("static block");
     ......

java exception java异常汇总(1)

 java exception 解决方案 - 我的异常网|异常|exception 730 - org.hibernate.LazyInitializationException:could not initialize proxy 731 - 警告: Error setting value 732 - override and commit 733 - Building workspace has encountered a problem. Errors during build 734 - Could not open the editor: An ......

Java Proxy动态代理

先看个例子:
接口
package example;
 
public interface Basic {
    public void hello();
}
 
接口的实现类
package example;
 
public class BasicService implements Basic {
    public void hello() {
        Sysyt ......

java配置环境变量

           unix系统:打开shell命令行
                输入vi _bash_profile 修改
                JA ......

java 连接 sap

源代码:
 import com.sap.mw.jco.*;
public class control extends Object
{
public static void main (String str[])
{
 control control=new control();
}
int count;
JCO.Client mConnection;
JCO.Repository mRepository;
String[] SAPInterfaces;
public control()
{
   try {
& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号