package ***does not exist!!!!!
counter.java:5: package gbk does not exist
import gbk.*;
^
1 error
[code]
StringChange.java
package gbk;
public class StringChange {
public StringChange(){}
public static String convert( String str ) {
if (str.trim()==""){
return null;
}
try {
/**Encodes this String into a sequence of bytes using the named * charset,
storing the result into a new byte array.
*/
byte[] bytesStr=str.getBytes( "ISO-8859-1" ) ;
/**Constructs a new String by decoding the specified array of * bytes
using the specified charset. The length of the new String * is a function of the
charset, and hence may not be equal to
* the length of the byte array.
*/
return new String( bytesStr, "GBK" ) ;
}
catch( Exception ex ) {
return str ;
}
}
}
Counter.java
package count;
import java.lang.*;
import java.util.*;
import gbk.*;
public class Counter{
private int count = 0;
StringChange ITG = new StringChange();
private String ddd = new String("ComeOnBaby!");
public Counter(){
}
public void setCount(int i){
this.count = i;
}
public int getCount(){
count++;
return this.count;
}
public String getDdd(){
return ddd;
}
public void setDdd(String s ){
String ss = new String();
ss = ITG.convert(s);
this.ddd = ss;
}
}