Question about Java Compiler Eclipse

+1 Abdu Lee · October 28, 2015
Hi,
I understand that this tutorial series is actually an old one but if I may ask, what are the changed that had happened?
Because I just want to know how to be able to actually run the codes that am writing here.

I tried researching the error that keeps popping up on Eclipse, it said "Write 'close()' at the end of the code";
I tried placing it in multiple of different places, but I can't seem to solve it.
Please I anyone could help me I would most definitely appreciate it.

PS: Awesome tutorial I want to learn programming, and you're doing a great job at teaching me, thanks bucky! ^^

Post a Reply

Replies

Oldest  Newest  Rating
0 Abdu Lee · November 3, 2015
Bump.
0 Kuroodo Ditory · November 3, 2015
You need to be more specific with your issue.

1. What are you trying to do?
2. Show us your code
3. What does the error say, or when you run the program, what kind of exception do you get?
4. Which video are you on?





But remembering now, I think you are referring to the use of Scanners?

Basically, if you don't close your scanner at the end of your code or atleast when you are done using it, you will get a warning (not an error).

What you can do is after you finish using your scanner, do myScanner.close();


Example:

public static void main (string[] args){
Scanner myScanner = new Scanner(system.in);

int x = myScanner.nextInt();

System.out.println(myScanner.nextLine());

// close the scanner after we finish using it.
myScanner.close();
}
  • 1

Java / Android Development

107,076 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator