我可以确定delphi按升序将整数分配给我创建的任何枚举吗?
type
TMyType = (mtFirst, mtSecond, mtThird);
Run Code Online (Sandbox Code Playgroud)
肯定mtFirts总是TmyType(1)???
我试着写代码 myTypeselection := TMyType(MyRadiogroup.ItemIndex+1);
但我失败的是,整数数值在某种程度上是混合的.
在java中传递某些类之间的值我们可以使用System.setProperty.但是使用System.getProperties()我们可以获得所有系统属性.因此,如果我使用任何第三方API意味着他们也可以访问我的属性,他们也可以更改.那么System.setProperty安全吗?
我知道
String value= value;
Intent i = new Intent(this, NextActivity.class);
i.putExtra("value",value + "");
startActivity(i)
Run Code Online (Sandbox Code Playgroud)
在NextActivity中
values = getIntent().getStringExtra("value");
Run Code Online (Sandbox Code Playgroud)
用来传递价值并获得价值..任何一个人都可以帮助我如何传递长期价值......
我知道我们可以获得很长的价值
getIntent().getLongExtra("");
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我如何传递值'putExtra'到我的知识用于传递字符串值..
您好我的代码正在抛出ClassCastException.StackTrace显示:
java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
at com.affiliate.DAO.AffiliateDAO.insertAffiliate(AffiliateDAO.java:48)
Run Code Online (Sandbox Code Playgroud)
即@ ps.setDate(6,(Date)affiliate.getDate()); 在DAO
下面是我的servlet:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Affiliate af= new Affiliate();
af.setFisrtName(request.getParameter("txtFname"));
af.setLastName(request.getParameter("txtLname"));
af.setGender(request.getParameter("txtGender"));
af.setCategory(request.getParameter("txtCategory"));
String dob=(request.getParameter("txtDob"));
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
Date date;
try {
date = (Date)formatter.parse(dob);
af.setDate(date);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
af.setAge(Integer.parseInt(request.getParameter("txtAge")));
af.setAddress(request.getParameter("txtAddr"));
af.setCountry("India");
af.setState(request.getParameter("txtState"));
af.setCity(request.getParameter("txtCity"));
af.setPinCode(Integer.parseInt(request.getParameter("txtPin")));
af.setEmailId(request.getParameter("txtEmail"));
af.setStd(Integer.parseInt(request.getParameter("txtStd")));
af.setContactNo(Integer.parseInt(request.getParameter("txtPhone")));
af.setMobileNo(Long.parseLong(request.getParameter("txtMobile"),10));
AffiliateService afs=new AffiliateService();
**afs.createAffiliate(af);**
}
Run Code Online (Sandbox Code Playgroud)
以下是我的DAO:
public void insertAffiliate(Affiliate …Run Code Online (Sandbox Code Playgroud) 我正在从一个单元格复制一个单元格样式,以将其用于许多其他行:
HSSFCellStyle styleHdr = workbook.createCellStyle();
if ( styleHeader != null)
styleHdr.cloneStyleFrom(styleHeader);
String regexNumbers = "(^[0-9]+[.]{0,1}[0-9]*$)";
String regNatZahl = "(^[0-9]+$)";
CellStyle numericStyle = workbook.createCellStyle();
numericStyle.setDataFormat((short) 0);
HSSFFont font= workbook.createFont();
font.setBoldweight((short) 0);
styleHdr.setBorderLeft(CellStyle.BORDER_NONE);
styleHdr.setBorderRight(CellStyle.BORDER_NONE);
styleHdr.setBorderBottom(CellStyle.BORDER_THIN);
styleHdr.setBorderTop(CellStyle.BORDER_NONE);
styleHdr.setFont(font);
styleHdr.setFillBackgroundColor(new HSSFColor.WHITE().getIndex());
Run Code Online (Sandbox Code Playgroud)
styleHeader的背景颜色为灰色,但是
styleHdr.setFillBackgroundColor(new HSSFColor.WHITE().getIndex());
Run Code Online (Sandbox Code Playgroud)
没有效果.其实我想删除backgroundColor而不是将其设置为白色.这也有可能吗?
谢谢你的建议!