2014-01-24 4 views
-1

클래스 A와 B 만 제대로 작동했지만 클래스 C를 추가하면 더 이상 "Hello"값을 반환하지 않습니다.문자열 값이 반환되지 않습니다.

클래스 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 (또는해야 I 말하는 방법 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'의 메소드에 문자열을 반환하지 않았습니다. –

관련 문제