Android studio 運(yùn)行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 運(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. java實(shí)現(xiàn)圖形化界面計(jì)算器2. IntelliJ Idea2017如何修改緩存文件的路徑3. IntelliJ IDEA設(shè)置條件斷點(diǎn)的方法步驟4. IIS Express 取代 ASP.NET Development Server的配置方法5. python flask框架快速入門6. Spring-Richclient 0.1.0 發(fā)布7. javascript設(shè)計(jì)模式 ? 建造者模式原理與應(yīng)用實(shí)例分析8. 淺談SpringMVC jsp前臺(tái)獲取參數(shù)的方式 EL表達(dá)式9. Python使用oslo.vmware管理ESXI虛擬機(jī)的示例參考10. Express 框架中使用 EJS 模板引擎并結(jié)合 silly-datetime 庫進(jìn)行日期格式化的實(shí)現(xiàn)方法
