Q:

Java Could not find Main class

I have a short question i have wrote this in java.
Old code:
   class apples{
        public static void main(String args[]){
            System.out.println("hello Youtube");
        }
    }

New code
public class apples{
        public static void main(String args[]){
            System.out.println("hello Youtube");
        }
    }

Eclipse give me this error:
Error: Could not find or load main class apples
What am I doing wrong? I am watching this tutorial from bucky : Youtube
Second Question:
In the tutorial there is something like Auto complete. How can I turn this on in eclipse?
FIXED: openend a file instead of class thanks for al the help!

A:

You must have a public class for the main method to be recognizable by the JVM.
Also, try to make use of package declarations. You can have something simple such as package com.foo.examples;.
For your second question: Autocomplete is turned on by default in Eclipse. In fact, I don't know how to turn it off!
Just use the shortcut Ctrl + Space in various places and see what happens. You can also type in a class say, System followed by a dot and see all the autocompletion entries for the visible static methods of System class.

