Android Studio: create Java project with no Android dependencies

前端 未结 10 1673
遇见更好的自我
遇见更好的自我 2020-12-12 16:20

It\'s possible to add pure Java module to existing Android project.

But is it possible to create pure Java project with no Android dependencies?

10条回答
  •  暖寄归人
    2020-12-12 17:09

    The easiest way to run a pure java program with input

    Follow these simple steps:

    1. Create a new project or open an existing project
    2. Right-click your package name under java directory > New > Scratch File
    3. Choose java from the dialog

    A class with name Scratch.java will open now you can write your code here...

    1. To run your program just right-click to Scratch.java and choose option -> Run 'Scratch.main()'

    Now you can see you program output. :)

提交回复
热议问题