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

📄 location.java

📁 j2me简单实例,j2me教程加源码,希望大家喜欢
💻 JAVA
字号:
package com.j2medev.chapter4;
//Location代表查询的位置
public class Location {
  
    private String[] location = new String[3];
    public static final int CITY = 0;
    public static final int REGION = 1;
    public static final int COUNTRY = 2;

    public Location() {
    }
    
    public String get(int field){
          if(field < 0 || field > 2)
            throw new IllegalArgumentException("The unit field is not defined");
          return location[field];
    }
    
    public void set(int index,String value){
        location[index] = value;
    }
    
    public String toString(){
        return "city : "+location[0]+"\n"
                +"region : "+location[1]+"\n"
                +"country : "+location[2]+"\n";
    }
}

⌨️ 快捷键说明

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