Android studio 運(yùn)行main 函數(shù)的方法
標(biāo)題Gradle構(gòu)建問(wèn)題
切換到Project工程下.idea/gradle.xml添加屬性<option name='delegatedBuild' value='false' />
圖例

PS:下面通過(guò)示例代碼看下JAVA中的main函數(shù)
package com.han;public class HanTest { public static void main(String[] args){ if(args==null){ throw new NullPointerException('The input is 'null''); }else if((args.length!=1&&args.length!=2)){ Throwable cause=new Throwable('You have to input 1 or 2 String arguments'); throw new IllegalArgumentException('Wrong numbers of args',cause); //throw new IllegalArgumentException('Wrong numbers of args'); }else if(args.length==1){ System.out.println(args[0]); }else if(args.length==2){ System.out.println(args[0]); System.out.println(args[1]); } }}package com.han;public class HanTest2 { public static void main(String[] args){ String[] input={'han'}; //HanTest.main(null); HanTest.main(input); }}
總結(jié)
到此這篇關(guān)于Android studio 運(yùn)行main 函數(shù)的方法的文章就介紹到這了,更多相關(guān)Android studio 運(yùn)行main 函數(shù)內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. PHP基礎(chǔ)之生成器4——比較生成器和迭代器對(duì)象2. Docker 啟動(dòng)Redis 并設(shè)置密碼的操作3. CentOS郵箱服務(wù)器搭建系列——SMTP服務(wù)器的構(gòu)建( Postfix )4. ASP新手必備的基礎(chǔ)知識(shí)5. asp文件用什么軟件編輯6. vue限制輸入數(shù)字或者保留兩位小數(shù)實(shí)現(xiàn)7. 利用CSS制作3D動(dòng)畫(huà)8. python 實(shí)現(xiàn)有道翻譯功能9. JAVA 實(shí)現(xiàn)延遲隊(duì)列的方法10. JS中6個(gè)對(duì)象數(shù)組去重的方法

網(wǎng)公網(wǎng)安備