java

Cannot be resolved to a type?


So I have been programming for all of 4 hours, I am using a this tutorial http://www.vogella.com/articles/Eclipse/article.html#eclipseoverview. when after copying the code I got an error cannot be resolved to a type. I then did what all my friends told me to do, look at the code. I spent an hour making sure mine looked like his.

the program is supposed to print hello world on to the screen. here is my attempt at it:

package de.vogella.eclipse.ide.first;
public class myFirstClass {
    public static void main(string[] args) {
        System.out.println("hello eclipse");
    }
}

In eclipse the word string is highlighted and it says that it cant be resolved to a type. I have also tried another java tutorial, Java total beginners, and this same problem appears. Any help would be appreciated, I'm totally new to programming, I try to learn more by using tutorials but this keeps stopping me (i know catch 22. Any advice that could help me get past this would be great, advice or maybe a question that already covered this any help would be great!!


Solution

  • public class myFirstClass {
        public static void main(string[] args) {
            System.out.println("hello eclipse");
        }
    }
    

    should be

    public class myFirstClass {
        public static void main(String[] args) { 
            System.out.println("hello eclipse");
        }
    }