⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 desk.java

📁 用NETBEANS做的一个关于Java的小小的demo.大家赐教
💻 JAVA
字号:
/*
 * Main.java
 *
 * Created on 2007年9月12日, 下午7:16
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package javaapplication1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 *
 * @author Administrator
 */

public class Desk {
    
    /** Creates a new instance of Main */
    private Suit s;
    private Value v;
    
    public Desk(Suit s, Value v) {
        this.s = s;
        this.v = v;
    }
    
    public void printSV(){
        System.out.println(s.toString() + " " + v.toString());
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Collection<String> c = new ArrayList<String>();
        c.add("aa");
        c.add("bb");
        printCollection(c);
    }
    
    public static void printCollection(Collection<?> c){
//        for(Object o : c){
//            System.out.println(o);
//        }
//        Vector<String> vs = new Vector<String>();
//        Vector<Integer> vi = new Vector<Integer>();
//        System.out.println(vs.getClass()==vi.getClass());
        List<Desk> desk = new ArrayList<Desk>();
        
        for(Suit suit : Suit.values())
            for(Value value : Value.values())
                desk.add(new Desk(suit,value));
        Collections.shuffle(desk);
        int i = 0;
        for(Desk m : desk){
            m.printSV();
            i ++ ;
        }
        System.out.println(i);
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -