①_java代码报错The constructor Card(String, String) is undefined_
你报错是因为你重载的构造器没有两个参数的;
在Card类中添加如下代码
public Card(String str,String point){
this.type = type ;
this.point = point ;
}
②_System.out.print();不换行_
System.out.println();换行
System.out.printf(“%.0f”,y);%为占位符,.0f为小数取0位,如123.5输出124,123.4输出123。.1f取1位,.2f取2位。
③_eclipse中由debug模式退出到正常编辑模式_
Window->Perspective->Open Perspective->Java 跳到编辑模式
④_for 语句_ 不带 大括号 只附带一条执行语句 不会执行到最后
⑤_BigInteger用法_
BigInteger.ONE(or TEN or ZERO)声明常数1(或10或0)
a.multiply(b) a乘b(某些情况可以以a为乘方对以b为底数进行反复乘)
a.subtract(b) a减b
⑥_return c-‘0’_
把c从别的格式转换为数值型
⑦a.charAt(0)方法
获取a字符串中的第1个字符
⑧a.substring(1)方法
获取a字符串从第2个开始及往后的字符串
⑨Vector
Vector是动态数组实现的List,跟ArrayList一样,其容量能自动增长
⑩List lst = new Vector();尖括号
jdk1.5后版本的新特性,泛型,指定传入的类型。这样定义之后,这个list只能接收Integer的对象。
笔记来自网络侵删歉