CSDN论坛 > Java > Java SE

帮我解译一下这段申明“private static String foo(final String name)” [问题点数:20分,结帖人kypfos]

Bbs7
本版专家分:22054
Blank
红花 2003年12月 Java大版内专家分月排行榜第一
2003年11月 Java大版内专家分月排行榜第一
结帖率 98.57%
Bbs6
本版专家分:7403
Bbs4
本版专家分:1084
Bbs7
本版专家分:10580
Bbs7
本版专家分:22054
Blank
红花 2003年12月 Java大版内专家分月排行榜第一
2003年11月 Java大版内专家分月排行榜第一
Bbs6
本版专家分:7403
Bbs7
本版专家分:22054
Blank
红花 2003年12月 Java大版内专家分月排行榜第一
2003年11月 Java大版内专家分月排行榜第一
Bbs4
本版专家分:1470
Bbs3
本版专家分:943
匿名用户不能发表回复!
其他相关推荐
java基础学习(7)浅析final,private,public,protected,static等关键以及它们的区别的联系
1.首先来谈final,它一般有三种用法,下面来分别介绍,简单来说定义变量,包括静态的和非静态的,或是定义方法的参数; 定义方法; 定义类。1.1 定义变量包括静态的和非静态的变量。大家都知道用final修饰的成员变量表示常量,值一旦给定就无法改变!给定的方式有三种:1)声明变量时直接赋值;2)非静态成员变量在{}块中赋值,静态成员变量在static{}块中赋值;3)非静态成员变量在构造方法中赋值。
学员信息管理系统
package com.jbit.util; /** * 常量列表 * @author xu.sun * */ public class SysConstants { public static final String SYS_PROPERTYNAME = "sys.properties"; public static final String SYS_LISTENERPORT = "PORT"; public static final String SYS_HOSTNAME = "HOST"; public static final String SYS_SUCCESS = "SUCCESS"; public static final String SYS_ERROR = "ERROR"; public static final String SYS_LOGIN = "LOGIN"; public static final String SYS_FIND = "FIND"; public static final String SYS_UPDATE = "UPDATE"; public static final String SYS_DELETE = "DELETE"; }
java 读取注册表 很好用的
调用runtime来执行注册表查询 private static final String PERSONAL_FOLDER_CMD = REGQUERY_UTIL + "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\" + "Explorer\\Shell Folders\" /v Personal"; private static final String CPU_SPEED_CMD = REGQUERY_UTIL + "\"HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\"" + " /v ~MHz"; private static final String CPU_NAME_CMD = REGQUERY_UTIL + "\"HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\"" + " /v ProcessorNameString"; private static final String HTTP_DEFAULT_BROWSERURI = REGQUERY_UTIL + "\"HKEY_CLASSES_ROOT\\http\\shell\\open\\command\"" +"" ;//http\\shell\\open\\ddeexec\\Topic private static final String HTTP_DEFAULT_BROWSERNAME = REGQUERY_UTIL + "\"HkEY_CLASSES_ROOT\\http\\shell\\open\\ddeexec\\Topic\"" +"" ;
Swing 8种主流皮肤
8种漂亮皮肤 使用方法 UIManager.setLookAndFeel(SwingUI.QuaQua); 变量定义 public class SwingUI { static final String JTattoo = "com.jtattoo.plaf.smart.SmartLookAndFeel"; static final String Office2003 = "org.fife.plaf.Office2003.Office2003LookAndFeel"; static final String Minrodlf = "com.nilo.plaf.nimrod.NimRODLookAndFeel"; static final String A03Laf = "a03.swing.plaf.A03LookAndFeel"; static final String Liquidlnf = "com.birosoft.liquid.LiquidLookAndFeel"; static final String PgsLookAndFeel = "com.pagosoft.plaf.PgsLookAndFeel"; static final String QuaQua = "ch.randelshofer.quaqua.BasicQuaquaLookAndFeel"; static final String Substance = "org.jvnet.substance.SubstanceLookAndFeel"; }
final 和static final 变量的引用不变
public class FinalReferenceTest { public static final StringBuffer sb = new StringBuffer(); public static void main(String[] args){ sb.append("hello"); } } 问题1:上面的程序能否编译
static、final的个人详解
1.static方法就是没有this的方法,在static方法内部不可以调用非static的方法,反过来是可以的。而且可以在没有任何对象创建的情况下,通过类名调用,这正是static的主要用途。一句话概括就是:方便在没有对象的情况下调用。 2.static可以用来修饰类的成员方法、类的成员变量,另外可以编写static代码块来优化程序性能。 3.为什么static方法中不能调用非static的
设计模式之单例模式程序
设计模式里面的单例模式程序 package com.rrppff; public class Singleton { private static String name; public static String getName() { return name; } public static void setName(String name) { Singleton.name = name; } private Singleton() { } private static Singleton instance = null; public static synchronized Singleton getInstance() { if(instance == null) instance = new Singleton(); return instance; } //private static Singleton instance = new Singleton(); //pulbic static Singleton getInstance(){ // return instance; //} }
java 个人记账管理系统
java语言写的android系统,用于个人账目管理,课程设计上写的欢迎下载 package moneymanager.moneymanager; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; /* * * 데이터베이스를 관리하는 클래스입니다. * */ public class DBAdapter { private static final String TAG = "NotesDbAdapter"; private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; // 데이터베이스이름과 테블이름들을 정의 private static final String DATABASE_NAME = "MoneyManagerDB"; private static final int DATABASE_VERSION = 2; private static final String DATABASE_SETTING_TABLE = "SettingTbl"; private static final String DATABASE_BADGET_TABLE = "BadgetTbl"; private static final String DATABASE_PAYMENT_TABLE = "PaymentTbl"; // 테블안의 항목들을 정의 public static final String KEY_SETTINGTBL_ID = "ID"; public static final String KEY_SETTINGTBL_NAME = "Name"; public static final String KEY_SETTINGTBL_VALUE = "Value"; public static final String KEY_BADGETTBL_ID = "ID"; public static final String KEY_BADGETTBL_ITEM = "Item"; public static final String KEY_BADGETTBL_MONEY = "Money"; public static final String KEY_PAYMENTTBL_ID = "ID"; public static final String KEY_PAYMENTTBL_BADGETID = "BadgetID"; public static final String KEY_PAYMENTTBL_OUTDATE = "OutDate"; public static final String KEY_PAYMENTTBL_MONEY = "Money"; public static final String KEY_PAYMENTTBL_NOTE = "Note"; private final Context mCtx; private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { String strCreateTbl; // SettingTbl생성 strCreateTbl = "CREATE TABLE " + DATABASE_SETTING_TABLE + " (" + KEY_SETTINGTBL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_SETTINGTBL_NAME + " TEXT NOT NULL, " + KEY_SETTINGTBL_VALUE + " TEXT NOT NULL);"; db.execSQL(strCreateTbl); // BadgetTbl생성 strCreateTbl = "CREATE TABLE " + DATABASE_BADGET_TABLE + " (" + KEY_BADGETTBL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_BADGETTBL_ITEM + " TEXT NOT NULL, " + KEY_BADGETTBL_MONEY + " INTEGER NOT NULL);"; db.execSQL(strCreateTbl); // PaymentTbl생성 strCreateTbl = "CREATE TABLE " + DATABASE_PAYMENT_TABLE + " (" + KEY_PAYMENTTBL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_PAYMENTTBL_BADGETID + " INTEGER NOT NULL, " + KEY_PAYMENTTBL_OUTDATE + " TEXT NOT NULL, " + KEY_PAYMENTTBL_MONEY + " INTEGER NOT NULL, " + KEY_PAYMENTTBL_NOTE + " TEXT);"; db.execSQL(strCreateTbl); } ......
模拟post提交json
private static final String APPLICATION_JSON = "application/json"; private static final String CONTENT_TYPE_TEXT_JSON = "text/json"; public static void httpPostWithJSON(String url, String js
i18n Tools helper
package tools.file; import info.monitorenter.cpdetector.io.ASCIIDetector; import info.monitorenter.cpdetector.io.CodepageDetectorProxy; import info.monitorenter.cpdetector.io.JChardetFacade; import info.monitorenter.cpdetector.io.ParsingDetector; import info.monitorenter.cpdetector.io.UnicodeDetector; import com.google.api.translate.Language; import com.google.api.translate.Translate; import java.io.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * . <p/> @author George Wei */ public class I18nTool { private static final String TEMP_RES_ENCODING = "gbk"; private static final String TEMP_RES_FILE = "D:/Temp/i18n/temp.properties"; private static final String FINAL_PROPERTIES_FILE = "D:/Temp/i18n/messages_zh.properties"; public static final int BUFF_SIZE = 10240;
关闭
关闭