把程序中大部分的变量放在一个类里()

本文介绍了一个用于创建和管理多种类型静态变量的Java类。该类包含整型、长整型、浮点型、字符串等不同类型的静态变量,并定义了数组及多维数组形式的变量。此外还提供了设置所有字符串变量后缀的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/**
 * 一般静态变量名全部采用大些字母,单本类考虑到和一般静态变量有所区别,所以采用了通常所采用的变量命名规则.
 * Var:Variable R:results T:Temp
 */

public final class VarCreater {

 

 public static Integer intRVar;
 public static Integer intTVar;
 public static Integer intT1Var;
 public static Integer intT2Var;
 public static Long longRVar;
 public static Long longTVar;
 public static Long longT1Var;
 public static Long longT2Var;
 public static Double douRVar;
 public static Double douTVar;
 public static Double douT1Var;
 public static Double douT2Var;
 public static String strRVar;
 public static String strTVar;
 public static String strT1Var;
 public static String strT2Var;
 public static Character charVar;
 public static Boolean boolVar;

 

 public static Integer intArrVar[];
 public static Long longArrVar[];
 public static Double douArrVar[];
 public static String strArrtrVar[];

 

 public static Integer intTwoArrVar[][];
 public static Long longTwoArrVar[][];
 public static Double douTwoArrVar[][];
 public static String strTwoArrtrVar[][];

 

 public static List<Object> list;
 public static Map<Object, Object> map;

 

 public static void setLastIndextToAll(String lastIndext) {
  strRVar = strRVar + lastIndext;
 }

 

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值