Eclipse Common commands + simple automated ticketing procedures

Source: Internet
Author: User

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) {


Scanner in = new Scanner (;

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 ("*********");


System.out.println ("Change:" + (amount-10));



Eclipse Common commands + simple automated ticketing procedures

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.