2011年10月27日 星期四

[遊戲開箱介紹] PS3 偶像大師2 (THE IDOLM@STER2)





下面是巴哈姆特的遊戲簡介:請點我

   PS3 版《偶像大師 2》是以今年 2 月推出的 Xbox 360
版為基礎所移植,遊戲中玩家將扮演經紀公司「765 製作」的新進製作人,從 9 名出道新人偶像中挑選 3
人組成偶像團體,以頂尖偶像為目標加以培育,體驗與自己栽培的偶像彼此互動一同成長的樂趣。


  PS3 版承襲 Xbox 360 版內容,並追加收錄前 3 波下載內容新增的服裝、歌曲與配件,以及電視動畫版主題曲「READY!!」,提供針對新手的「普通」與針對老手的「超越」兩種不同難度。



2011年10月24日 星期一

[MEMO] JAVA 實作 this

package test;

public class test111024 {

public static void main (String args[])
{

Car car = new Car(4,"Benz");
car.printData();

}


}

class Car{

protected int wheel;
protected String name;

public Car(int wheel,String name)
{

this.name = name;
this.wheel = wheel;


}



public void printData()
{

System.out.println("The car has: " + wheel + " wheels.");
System.out.println();
System.out.println("The car's name is: " + name + ".");
}
}

2011年10月23日 星期日

[遊戲介紹][心得] 蝙蝠俠:阿卡漢城市




在百年校慶活動開跑前終於讓我拿到蝙蝠俠的最新系列作──「阿卡漢城市」了!





↑  本次普版附贈的資料夾 & 遊戲本體包裝


2011年10月20日 星期四

[遊戲開箱介紹] PSP 火影忍者 疾風傳



原本以為會等到杯麵的~ 想不到今天九點是等到這個:PSP 火影忍者 疾風傳

除了遊戲片還有一個特典:寫輪眼......


[MEMO] JAVA 實作

剛剛參考別人網誌對於Hashtable的使用...遇到了幾個提示


原址:http://blog.yam.com/bluelanguage/article/8401664

以下是人家的 code 經過我重新修正後:




package hoge;

import java.util.*;
import java.io.*;

class Student {
private String number;
private String name;
private double score;

public Student(String number, String name, double score) {
this.number = number;
this.name = name;
this.score = score;
}

public String getNumber() {
return number;
}

public String getName() {
return name;
}

public double getScore() {
return score;
}
}

public class Convert2 {
    public static void main(String[] args) {
        try {
            OpHashtable();
        }
        catch(IOException e) {
            System.out.println(e.toString());
        }
    }

    private static void OpHashtable() throws IOException {
        Hashtable table = new Hashtable();
        BufferedReader buf = new BufferedReader(
        new InputStreamReader(System.in));
        int select;
        String number, name;
        double score;
        Object val;
        Student student;

        System.out.println("使用Hashtable類別");
        while(true) {
            System.out.println("(1) 加入學生資料");
            System.out.println("(2) 查詢學生資料");
            System.out.println("(3) 移除學生資料");
            System.out.println("(4) 列出所有資料");
            System.out.println("(5) 離開");
            System.out.print("> ");
            select = Integer.parseInt(buf.readLine());

            switch(select) {
                case 1:
                    System.out.print("學號: ");
                    number = buf.readLine();
                    System.out.print("姓名: ");
                    name = buf.readLine();
                    System.out.print("成績: ");
                    score = Double.parseDouble(buf.readLine());
                    student = new Student(number, name, score);
                    val = table.put(number, student);

                    if(val == null){
                        System.out.println("資料存入....");}
                    else{
                        System.out.println("資料取代....");

                        break;}
                case 2:
                    System.out.print("學號: ");
                    number = buf.readLine();
                    student = (Student) table.get(number);
                    if(student != null)
                    {System.out.println("學號: " + student.getNumber() +
                " 姓名: " + student.getName() +
                " 成績: " + student.getScore());}
                    else
                    {System.out.println("查無此筆資料....");
                    break;}
                case 3:
                    System.out.print("學號: ");
                    number = buf.readLine();
                    val = table.remove(number);
                    if(val != null)
                        {System.out.println("學生 " + number + " 資料移除");}
                    else
                    {System.out.println("查無此筆資料....");
                    break;}
                case 4:
                {Enumeration e = table.elements();
                    while(e.hasMoreElements()) {
                        student = (Student) e.nextElement();
                        System.out.println("學號: " + student.getNumber() +
                                " 姓名: " + student.getName() +
                                " 成績: " + student.getScore());
                        }
                    break;}
                case 5:
                {efault:System.exit(0);}
                }
        }
    }
}


 


 


在Hashtable的地方看到了一個提示


 


**** is a raw type. References to generic type ***** should be parameterized. 」


 


拿去Google後有人建議先去看泛型的 document......, 索性整理了一下。


http://www.javaworld.com.tw/jute/post/view?bid=5&id=105545&sty=3&tpg=1&age=0


http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf


2011年10月19日 星期三

[遊戲開箱介紹] 黑暗靈魂 Dark Souls



十月的第四周重頭戲之一

PS3上頭讓人難以忘懷的老馬續作 ── 黑暗靈魂 中文版!終於上市啦~~~


2011年10月18日 星期二

[MEMO] JAVA 實作

取自 JAVA由初學邁向認證


範例  Chap5 DefineClass2


 


public class DefineClass2 {
    public static void main(String[] args){
        Vehicle newCar1 = new Vehicle();    //實體化一個物件
        Vehicle newCar2 = new Vehicle();    //再實體化另一個物件
        Vehicle rCar;                        //只是一個參考

        rCar = newCar1;                        //rCar指向newCar1

        newCar1.wheel = 4;                //指定實體變數的值
        newCar2.wheel = 8;
        rCar.wheel = 6;                    //現在,newCar1的值也會更改
        System.out.println("newCar1車子有 " + newCar1.wheel + " 個輪子");
        System.out.println("newCar2車子有 " + newCar2.wheel + " 個輪子");
    }
}

class Vehicle{        //定義的類別
    int wheel;        //定義一個實體變數
}


 


 


上面是附在光碟中的 code, 但是在我使用 Eclipse 編譯照抄時卻出現錯誤。


除了我不小心把 code 包到 main{}裏頭之外額外發現了其他寫法。


下面是我寫錯的程式段:


main{


class Vehicle{        //定義的類別
    int wheel;        //定義一個實體變數
}


}




 


說法一:




這是因為在 main {}  裏頭 Vehicle 是一個 動態 的內部類別,創建這樣的對象必須有實體與之對應,


程式是在靜態方法中直接調用動態內部類別所以會報出這樣錯誤。  


這樣的錯誤好比類中的"靜態方法(static method)"不能直接調用動態方法。


所以可以把該內部類聲明為 static ,或者不要在靜態方法中調用他。




那麼......為啥非靜態方法不能調用動態方法呢?


從面向對象(ex: 物件)的角度來說,動態方法與對象(物件)是聯繫密切的,


比如:「發動」 是一個方法(method),它與「汽車」這個對象(物件)是關聯的,


所以只有 new 了汽車這個對象才能執行 汽車.發動





說法二:


內部類別實體依存於外部類別實體;


外部類別的靜態方法可以直接被調用,而不需要 new 外部類別實體;


所以在外部類別的靜態方法中直接實體化內部類別就會出現這個編譯錯誤。


 


上面是我在網路上看到關於錯誤的部分說明將之整理後的解釋。


 


所以我把 code 改成如下:


public class DefineClass2 {
    //public int Vehicle;
    
    public static void main(String  args[])
    {
        class Vehicle // 定義類別
        {
            
            int wheel; // 定義一個實體變數
            
            
        }

        
        Vehicle newCar1 = new Vehicle(); // 實體化類別中物件
        Vehicle newCar2 = new Vehicle(); // 同上


//「什麼是物件?」


// 物件是可以視為同一單位的程式碼和資料的組合。


// 物件可以是應用程式的一個片段,例如控制項或表單。


// 整個應用程式也可以是個物件。




//「什麼是變數?」 


// 簡單的說,就是讓某一個特定字串代表不固定的內容就是了。


// 舉個大家在國中都會學到的數學例子,
那就是:『 y = ax + b 』這東西。


// 在等號左邊的(y)就是變數,在等號右邊的(ax+b)就是變數內容。


// 要注意的是,左邊是未知數,右邊是已知數喔!


// 講的更簡單一點,我們可以『用一個簡單的 "字眼"
來取代另一個比較複雜或者是容易變動的資料』。


// 這有什麼好處啊?最大的好處就是『方便!』。


 



        Vehicle rCar;  // 參考
        rCar  = newCar1; // rCar 指向 newCar1
        
        newCar1.wheel = 4; // 指定一個值 給予 實體變數
        newCar2.wheel = 8; // 同上
        rCar.wheel = 6;  // 因為 rCar 指向 newCar1 所以這裡會讓"6"取代前兩行所指定的值 = > "4"


 



        System.out.println("newCar1 has " + newCar1.wheel + " tires.");
    
        System.out.println("newCar2 has " + newCar2.wheel + " tires.");
        
    }
    
    
}


2011年10月11日 星期二

[遊戲開箱介紹] Rage 狂怒煉獄



10月最精華的幾個禮拜~~數個強作連番上陣!

度過了國慶連假後終於讓我拿到限量版的 Rage ......

跨過三個平台的這款遊戲限量版內容如下:



‧遊戲片本體

‧特典序號

‧三本漫畫