Android studio 運行main 函數(shù)的方法
標(biāo)題Gradle構(gòu)建問題
切換到Project工程下.idea/gradle.xml添加屬性<option name='delegatedBuild' value='false' />
圖例
PS:下面通過示例代碼看下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 運行main 函數(shù)的方法的文章就介紹到這了,更多相關(guān)Android studio 運行main 函數(shù)內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. ASP刪除img標(biāo)簽的style屬性只保留src的正則函數(shù)2. asp(vbscript)中自定義函數(shù)的默認參數(shù)實現(xiàn)代碼3. 如何使用瀏覽器擴展篡改網(wǎng)頁中的JS 文件4. JSP servlet實現(xiàn)文件上傳下載和刪除5. jsp中sitemesh修改tagRule技術(shù)分享6. Ajax實現(xiàn)表格中信息不刷新頁面進行更新數(shù)據(jù)7. 爬取今日頭條Ajax請求8. JavaWeb Servlet中url-pattern的使用9. ASP基礎(chǔ)知識VBScript基本元素講解10. jsp EL表達式詳解
