chief
chief

Reputation: 23

string cannot be resolved to a type

I am getting a "string cannot be resolved to a type" error in my code.

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;

  }

Upvotes: 2

Views: 14475

Answers (1)

jjnguy
jjnguy

Reputation: 138972

String is capitalized in Java. You cannot use lowercase string. (That's C#)

Side question:
How is the following compiling at all?

template.composeFormLetter(Sean, Colbert, God);

Upvotes: 7

Related Questions