我在转换整数向量时遇到问题,如下所示.转换字符串是可以的,但我遇到了整数问题.
private Vector a = new Vector();
Record record = new Record();
record.setName((String) listName.elementAt(i));
record.setPrice((int) listPrice.elementAt(index));
a.addElement(record);
Run Code Online (Sandbox Code Playgroud)
下面是类Record
package goldenicon;
public class Record {
String name;
int price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}
Run Code Online (Sandbox Code Playgroud) 我想在Android应用程序中使用新的自定义字体.请在解释时准确而具体,我是新手.也就是说,我想让我的Android应用程序使用这些新的Android自定义字体http://developer.android.com/design/style/typography.html.谢谢.请帮忙.
我想知道为什么我的载体会重复?我知道我可以使用ArrayList,但这是我的黑莓应用程序的测试,目前只使用向量.这是我继续得到的结果:
ID:3 and Name:Catty and Price:100 and Msg:Catty is a preety girl
ID:3 and Name:Catty and Price:100 and Msg:Catty is a preety girl
ID:3 and Name:Catty and Price:100 and Msg:Catty is a preety girl
Run Code Online (Sandbox Code Playgroud)
这是代码testapp.java
package testing;
import java.util.Vector;
public class testapp {
private static Vector<String> listElements= new Vector<String>();
private static Vector<String> listName= new Vector<String>();
private static Vector<Integer> listPrice= new Vector<Integer>();
private static Vector<String> listDate= new Vector<String>();
private static Vector<String> listAbstract= new Vector<String>();
private static Vector<rec> a = new …
Run Code Online (Sandbox Code Playgroud)