英文:
What happens if I create a class with main thread in android studio
问题
如果我在Android Studio中创建一个带有main
方法的Java类,会对我的mainActivity
和其他活动产生影响吗?这会如何影响它们?我在使用Android Studio方面有点新手…
英文:
If I create a java class with the main method within Android Studio does it affect my activities both mainActivity
and others and how does it affect them?
I am a bit new to Android studio ...
答案1
得分: 2
我猜你指的是 main
方法。安卓对一个名为 "main" 的方法并没有特殊的含义。如果你在任何一个类中放置了一个 main 方法,除非你自己调用它,否则它会被忽略。
英文:
I assume you mean the main
method. Android gives no special meaning to a method called "main". If you put a main method in any of your classes it'll just be ignored, unless you call it yourself.
专注分享java语言的经验与见解,让所有开发者获益!
评论