2014-01-24 42 views
-1

它只与A类和B类工作正常,但是当我添加类C时,它不会返回值“你好”了。字符串值不会返回

A类:

public void firstName() { 
     Deco dec = new Deco(); 
     x=dec.first; 
     System.out.println("value: "+x); 

B类(装饰类):

public String firstOne(byte[] b) throws Exception { 
    if(xxx.equals(y)){ 
      String first="Hello"; 
     return(first); 

    }else{ 
      System.out.println("Error"); 
    } 

C类:

public String test(String path, String name) { 
    decode = decode_text(get_byte_data(image)); 
    Deco dec = new Deco(); 
dec.firstOne(decode); 

} 
+0

什么编程语言? – NoChance

+2

什么是'xxx'?还有什么想念你应该包括? – hatchet

+0

看起来像'C#' - 请确认并标记问题。 – mklement0

回答

0

C类(或者应该说方法C)没有按”看起来像它返回任何东西,也许是这样的:

public String test(String path, String name) { 
decode = decode_text(get_byte_data(image)); 
Deco dec = new Deco(); 
return dec.firstOne(decode); 

} 
+0

当我发布时,我忘了放置'return'。 'firstOne'的方法没有返回一个字符串给'firstName'的方法。 –