Alt+/a class quickly. such as the Scanner class. Re-enter the time can scan here when the use of "alt+/" then you will find and scanner related to the following pull-down menu of the way to bounce out, here to choose the first
Scanner class will be directly out, while the first line of code to join the import java.util.scanner.*;
Scanner is an input class, Java does not automatically load, using this class requires import of this package.
Select multiple lines: shift+↑ or shift+↓ select Multiline plus comment: ctrl+/
Single-line plus comment ctrl+/
A simple automated ticketing procedure.
Import java.util.scanner.*;
public class tickt{
public static void Main (string[] args) {
Initialization
Scanner in = new Scanner (system.in);
Put change
int amount = In.nextint ();
Print Tickets
System.out.println ("*********");
System.out.println ("*java intercity train *");
System.out.println ("Fare: 10 Yuan");
System.out.println ("*********");
Change
System.out.println ("Change:" + (amount-10));
}
}
Eclipse Common commands + simple automated ticketing procedures