-1
import java.util.*;
package everything_is_an_object;


class MyClass {
	int i;
	char c;
}

public class Main {
	public static void main(String[] args)
	{
		MyClass x = new MyClass();
		System.out.println(x.i);
		System.out.println(x.c);
	}
}

My error is on the second line,that was generated by my IDE,with the package. What si the problem ?

2
Contributors
7
Replies
8
Views
6 Years
Discussion Span
Last Post by Ezzaral
0

Doing that it always give me a warning: The import java.util is never used. How can I get rid of that warning ?

0

One more question i have,for every program i need a package ? i am making exercises from a book,i want to organize them by chapters*folders) but when i create a package in my folder,it creates it always in SRC folder.

0

If you designate a package, the file must appear in a directory of the same name. You are not required to use packages, but it does keep things more organized.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.