写一个类TestType,输出各类型的默认值

本文通过一个简单的Java程序演示了int、short、long、float、double、boolean、char及String等基本类型的默认值,并展示了如何在程序中输出这些默认值。

写一个类TestType,打印出int,short,long,float,double,boolean,char,String的默认值

public class TestType {
  private static int inttype;
  private static short shorttype;
  private static long longtype;
  private static float floattype;
  private static double doubletype;
  private static boolean booleantype;
  private static char chartype;
  private static String stringtype;
//声明 int,short,long,float,double,boolean,char,String、类型的type
  public static void main(String[] args) {

 
  System.out.println("inttype:"+inttype);
  System.out.println("shorttype:"+shorttype);
  System.out.println("longtype:"+longtype);
  System.out.println("floattype:"+floattype);
  System.out.println("doubletype:"+doubletype);
  System.out.println("booleantype:"+booleantype);
  System.out.println("chartype:"+chartype);
  System.out.println("stringtype:"+stringtype);
  }//在主函数中输出
}

运行结果:
inttype:0
shorttype:0
longtype:0
floattype:0.0
doubletype:0.0
booleantype:false
chartype:

private void GetSiffInfo(int xshift, int yshift) { const int minColumn = 11; var fileContent = m_Reader.ReadLine().Trim(); Debug.Assert(fileContent != null, "fileContent != null"); //逐行读取文件 var titleSplit = fileContent.Split(new char[] { ',' }); if (titleSplit.Length < minColumn) { return; } var wafer = new List<SITE>(); var indexList = new List<string>(); var goodBins = new Dictionary<string, string>(); //goodBins.Add("0", "G");//20210705 add for Sunnyvale goodBins.Add("1", "G"); var binSummary = new Dictionary<string, int>(); var totalPass = 0; var totalFail = 0; while ((fileContent = this.m_Reader.ReadLine()) != null) { var resultItems = fileContent.Split(new char[] { ',' }); if (resultItems[0] == "SN") { continue; } if (resultItems.Length < minColumn) { continue; } if (m_WaferID == "") { string temp = resultItems[8]; string[] parts = temp.Split('-'); m_WaferID = parts[1]; //m_WaferID = resultItems[8]; m_WaferID = m_WaferID.Length == 1 ? "0" + m_WaferID : m_WaferID; } if (m_LotID == "") { string temp = resultItems[8]; //string[] parts = temp.Split('-'); //m_LotID = parts[1]; m_LotID = resultItems[8]; //if (m_LotID.Substring(0, 1) != "A" && m_LotID.Substring(0, 1) != "B" && m_LotID.Substring(0, 1) != "X") //{ //m_productID = "0183C01-000-A"; //GetRealLotWaferInfo(); //} //针对Lot信息为Icrd的,读取IcrdWaferMapping表获取真实Lot和Wafer信息--20200701 if (m_LotID.Substring(0, 2) == "XP") { //m_productID = "0183C01-000-A"; GetIcrdLotWaferInfo(); GetProductID(); } else { //GetProductID(); //m_LotID = "FS00009"; m_LotID = "FS00004"; m_productID = "1022A01-UF1-F"; } var binDefPath = ""; var waferPatternPath = ""; if (m_productID.Length != 0) { //binDefPath = @"E:\Translator\" + m_productID.Substring(0, 4) + " Bin Definition.csv"; //waferPatternPath = @"E:\Translator\" + m_productID.Substring(0, 4) + " Wafer Pattern.csv"; #if DEBUG binDefPath = @"D:\Project\Translator\" + m_productID.Substring(0, 4) + " Bin Definition.csv"; waferPatternPath = @"D:\Project\Translator\" + m_productID.Substring(0, 4) + " Wafer Pattern.csv"; #endif } if (m_productID.Contains("0168") || m_productID.Contains("0425") || m_productID.Contains("0496") || m_productID.Contains("0635") || m_productID.Contains("0636"))//20221215 add 0425 { m_Flat = "RIGHT"; goodBins.Add("0", "G");//20210705 add for 0168 } GetBinDefintion(binDefPath); GetWaferPattern(waferPatternPath, 4); // 位数修改 } if (m_ProbeCard == "") { m_ProbeCard = resultItems[6].Trim(); } if (m_TestStation == "") { m_TestStation = resultItems[2].Trim(); } if (m_StartTime == "") { m_StartTime = DealTimeString(resultItems[4].Trim()); } if (m_Program == "") { m_Program = resultItems[6].Trim(); //m_Program = "NONE";//0425专用 if (m_Program.Contains("_FS_")) { m_TestType = "CIS_FS"; } else if (m_Program.Contains("_SS_")) { m_TestType = "CIS_SS"; } _isReverse = false; //0168新增Goodbin--20211110 if (m_productID.Substring(0, 4) == "0168") { //goodBins.Add("231", "G"); //goodBins.Add("261", "G"); //goodBins.Add("271", "G"); //goodBins.Add("281", "G"); //goodBins.Add("282", "G"); //goodBins.Add("581", "G"); //goodBins.Add("582", "G"); //goodBins.Add("583", "G"); //goodBins.Add("601", "G"); //goodBins.Add("602", "G"); //goodBins.Add("606", "G"); //goodBins.Add("607", "G"); //goodBins.Add("611", "G"); //goodBins.Add("612", "G"); //goodBins.Add("641", "G"); //goodBins.Add("642", "G"); ////20221201 新添加GoodBin //goodBins.Add("251", "G"); //goodBins.Add("252", "G"); //goodBins.Add("275", "G"); //20230922 更新所有 goodBins.Add("211", "G"); goodBins.Add("231", "G"); goodBins.Add("251", "G"); goodBins.Add("252", "G"); goodBins.Add("261", "G"); goodBins.Add("271", "G"); goodBins.Add("275", "G"); goodBins.Add("276", "G"); goodBins.Add("277", "G"); goodBins.Add("278", "G"); goodBins.Add("279", "G"); goodBins.Add("281", "G"); goodBins.Add("282", "G"); goodBins.Add("291", "G"); goodBins.Add("581", "G"); goodBins.Add("582", "G"); goodBins.Add("583", "G"); goodBins.Add("601", "G"); goodBins.Add("602", "G"); } //20230811 0496新增Goodbin //20240116 Good bin更新同0168 else if (m_productID.Substring(0, 4) == "0496" || m_productID.Substring(0, 4) == "0425") { goodBins.Add("211", "G"); goodBins.Add("231", "G"); goodBins.Add("251", "G"); goodBins.Add("252", "G"); goodBins.Add("261", "G"); goodBins.Add("271", "G"); goodBins.Add("275", "G"); goodBins.Add("276", "G"); goodBins.Add("277", "G"); goodBins.Add("278", "G"); goodBins.Add("279", "G"); goodBins.Add("281", "G"); goodBins.Add("282", "G"); goodBins.Add("291", "G"); goodBins.Add("581", "G"); goodBins.Add("582", "G"); goodBins.Add("583", "G"); goodBins.Add("601", "G"); goodBins.Add("602", "G"); } //20230905 0636新增Goodbin //20240116 Good bin更新同0168 else if (m_productID.Substring(0, 4) == "0636" || m_productID.Substring(0, 4) == "0635") { goodBins.Add("211", "G"); goodBins.Add("231", "G"); goodBins.Add("251", "G"); goodBins.Add("252", "G"); goodBins.Add("261", "G"); goodBins.Add("271", "G"); goodBins.Add("275", "G"); goodBins.Add("276", "G"); goodBins.Add("277", "G"); goodBins.Add("278", "G"); goodBins.Add("279", "G"); goodBins.Add("281", "G"); goodBins.Add("282", "G"); goodBins.Add("291", "G"); goodBins.Add("581", "G"); goodBins.Add("582", "G"); goodBins.Add("583", "G"); goodBins.Add("601", "G"); goodBins.Add("602", "G"); } else if (m_productID.Substring(0, 4) == "0829") { goodBins.Add("2", "G"); goodBins.Add("3", "G"); } if (m_Program == "") { throw new Exception("m_Program为空!!"); } } var binCode = resultItems[11].Trim(); if (!m_BinDef.ContainsKey(binCode) && binCode != "") { m_BinDef[binCode] = binCode + "?"; } if (goodBins.Keys.Contains(binCode)) { if (goodBins[binCode] == "G") { totalPass++; } } else { totalFail++; } var currentSite = new SITE(m_LotID, m_WaferID, resultItems[9], resultItems[10], binCode, m_WaferPattern.Count, _isReverse); if (binSummary.ContainsKey(currentSite.m_HardBin)) { binSummary[currentSite.m_HardBin]++; } else { binSummary.Add(currentSite.m_HardBin, 1); } //deal retest site if (resultItems[9] == "" || resultItems[10] == "") continue; var indexstring = resultItems[9] + "," + resultItems[10]; if (indexList.Contains(indexstring)) { var index = indexList.IndexOf(indexstring); wafer[index] = new SITE(currentSite); } else { wafer.Add(currentSite); } } foreach (var key in binSummary.Keys) { var binStatus = "B"; if (goodBins.Keys.Contains(key)) { binStatus = goodBins[key]; } if (key == "") continue; //不添加未测 site统计结果; SortBinList.Add(new CISCSVBin(key, m_BinDef[key], binSummary[key].ToString(), binStatus)); } if (totalPass == 0) { //SortBinList.Add(new CISCSVBin("0", m_BinDef["0"], "0", "G")); } m_waferMap = new List<string>(m_WaferPattern); for (int j = 0; j < wafer.Count; j++) { if (j == 444) { int temp = 0; } if (!_dealCP) { continue; } try { int x = 0; //X轴从0开始计数 int y = 0; x = Convert.ToInt32(wafer[j].m_XIndex) - xshift; //X轴从0开始计数 y = Convert.ToInt32(wafer[j].m_YIndex) - yshift; //Y轴从0开始计数 if (x < 0 || y < 0) { continue; } if (x == m_waferMap[y].Length / 4 - 1) { m_waferMap[y] = m_waferMap[y].Substring(0, x * 4) + wafer[j].m_BinCode; continue; } m_waferMap[y] = m_waferMap[y].Substring(0, x * 4) + wafer[j].m_BinCode + m_waferMap[y].Substring(x * 4 + 4); } catch (Exception e) { Console.WriteLine(e.ToString()); throw; } } m_TotalPass = totalPass.ToString(); m_TotalFail = totalFail.ToString(); m_TotalTest = wafer.Count.ToString(); m_GrossDice = m_TotalTest; m_EndTime = m_StartTime; m_Process = ""; m_Owner = ""; m_SlotID = m_LotID; m_Operator = ""; m_TesterType = ""; m_TestHead = ""; //m_Flat = "DOWN"; m_Prober = ""; m_LoadBoard = ""; m_Status = ""; m_TEMP = ""; m_Customer = ""; }
最新发布
11-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值