簡體   English   中英

字符串無法解析為類型

[英]string cannot be resolved to a type

我的代碼中出現“字符串無法解析為類型”錯誤。

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;

  }

String用Java大寫。 您不能使用小寫string (這是C#)

附帶問題:
以下內容如何編譯?

template.composeFormLetter(Sean, Colbert, God);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM