public class Zhifuchuan {
public static void main(String[] args) {
String str=" MLDN Java技术学习班20070326 老师";
System.out.println(str.substring(15,23));
System.out.println(str.charAt(7));
System.out.println(str.trim());
String newStr=str.replace("ava","2EE");
System.out.println("替换之后的结果:"+newStr);
// TODO Auto-generated method stub
}
}
public class Qingchu {
/**
* @param args
*/
public static void main(String args[]) {
String str=" MLDN Java技术学习班20070326 老师";
str=str.replace("0","");
System.out.println("str:"+str);
// TODO Auto-generated method stub
}
}
public class Chushenriqi {
public static void main(String[] args) {
String str="32083019980423141X";
System.out.println(str.substring(6,14));
// TODO Auto-generated method stub
}
}
class Tushu1{
private String name;
private int num;
private float price;
private int ceshu;
private int count;
public Tushu1(String name,int num,float price){
this.setName(name);
this.setNum(num);
this.setPrice(price);
this.setCeshu(ceshu);
this.setCount(count);
}
public String getName(){
return name;
}
public void setName(String n){
name=n;
}
public int getNum(){
return num;
}
public void setNum(int n){
num=n;
}
public float getPrice(){
return price;
}
public void setPrice(float p){
price=p;
}
public int getCeshu(){
return ceshu;
}
public void setCeshu(int c){
c=num++;
ceshu=c;
}
public int getCount(){
return count;
}
public void setCount(int co){
co=ceshu;
count=co;
}
}
public class Tushu {
/**
* @param args
*/
public static void main(String[] args) {
Tushu1 tu=null;
tu=new Tushu1("老人与海",1,30.5f);
System.out.println("书名:"+tu.getName());
System.out.println("编号:"+tu.getNum());
System.out.println("价格:"+tu.getPrice());
tu=new Tushu1("狂人日记",2,30.5f);
System.out.println("书名:"+tu.getName());
System.out.println("编号:"+tu.getNum());
System.out.println("价格:"+tu.getPrice());
System.out.println("册数:"+tu.getCeshu());
System.out.println("总数:"+tu.getCount());// TODO Auto-generated method stub
}
}