Android Studio running Java program

Source: Internet
Author: User

When we installed Android Studio to learn Android development, it is inevitable to learn Java, this time, is it re-install a compiler? No, we can do it directly with Android Studio.

1, create a new empty project, select the Red Project

2.   File-----> New-----> New Module ... Then pop a box inside the more module to select the Java Library. All the way next.

3, write the corresponding code, remember to comment out the first line above

4, configuration, click Run--Edit configuration, click the Green Plus button above the new pop-up window, select "Application", and then add the information in the right window.

5, finally in their own code to write the interface right-click, select "Run Class.main ()", or use the shortcut key "Ctr+shift+f10" to run. Results such as:

Android Studio running Java program

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: info-contact@alibabacloud.com 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.