字符串无法解析为某个类型

时间:2010-10-07 00:13:18

标签: java

我的代码中出现“字符串无法解析为类型”错误。

public class Main {


 public static void main(String[] args) {
  // TODO Auto-generated method stub
  FormLetter template;
  template = new FormLetter();
  template.print();
  template.composeFormLetter(Sean, Colbert, God);
  template.print();

 }

}

class FormLetter
 {
  public void print(){
    System.out.println(to + candidate + from);

  }  

  public void composeFormLetter(string t, string c, string f){

   to = t;
   candidate = c; 
   from = f;
  } 
   private string to;
   private string candidate;
   private string from;

  }

1 个答案:

答案 0 :(得分:7)

String在Java中大写。您不能使用小写string。 (那是C#)

提问:
如何进行以下编译?

template.composeFormLetter(Sean, Colbert, God);