package static1;
import org.junit.Test;
public class static1 {
public static int num=0;
public void addation(){
this.num++;
}
public static String change(String str,int flag){
if(flag==0){
return str.toUpperCase();//大写
}else if(flag==1){
return str.toLowerCase();//小写
}else{
return str;//原样返回
}
}
@Test
public void test(){
static1 count=new static1();
count.addation();
System.out.println(static1.num);
}
@Test
public void test1(){
String str=static1.change("fdsFDSGsf", 2);
System.out.println(str);
}
}
import org.junit.Test;
public class static1 {
public static int num=0;
public void addation(){
this.num++;
}
public static String change(String str,int flag){
if(flag==0){
return str.toUpperCase();//大写
}else if(flag==1){
return str.toLowerCase();//小写
}else{
return str;//原样返回
}
}
@Test
public void test(){
static1 count=new static1();
count.addation();
System.out.println(static1.num);
}
@Test
public void test1(){
String str=static1.change("fdsFDSGsf", 2);
System.out.println(str);
}
}