急!!! java编程! 求大神帮助! 题目如下图: 写一个driver program , p 100
急!!!java编程!求大神帮助!题目如下图:写一个driverprogram,partA:写createList方法构建ArrayListobject范围从10-99的...
急!!! java编程! 求大神帮助! 题目如下图: 写一个driver program , part A: 写createList方法 构建 ArrayList object 范围从10-99的随机整数 把这些整数输进 ArrayList object 并 return Array object. ( public static ArrayList<Integer> createList(int n) )
Part B: 写方法 getMean , return 平均数 ( public static double getMean( ArrayList<Integer> list) )
Part c: 写方法 getMedian , return 中位数, (写getMedian方法需要用 sort 方法)
Import Java.util.Collections;
Collections.sort(list);
( public static public getMedian(ArrayList<Integer> list))
自己试着写了,但是不工作。要是哪位大神愿意指导一下也行 非常感谢 展开
Part B: 写方法 getMean , return 平均数 ( public static double getMean( ArrayList<Integer> list) )
Part c: 写方法 getMedian , return 中位数, (写getMedian方法需要用 sort 方法)
Import Java.util.Collections;
Collections.sort(list);
( public static public getMedian(ArrayList<Integer> list))
自己试着写了,但是不工作。要是哪位大神愿意指导一下也行 非常感谢 展开
1个回答
展开全部
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.garena.game.lfstw/com.aiming.lfs.LFSActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2421)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5432)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:735)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
at com.aiming.lfs.billing.util.IabHelper.startSetup(IabHelper.java:269)
at com.aiming.lfs.billing.BillingProcessor.setupBilling(BillingProcessor.java:64)
at com.aiming.lfs.billing.BillingProcessor.initialize(BillingProcessor.java:38)
at com.aiming.lfs.LFSActivity.onCreate(LFSActivity.java:89)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2421)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5432)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:735)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
at com.aiming.lfs.billing.util.IabHelper.startSetup(IabHelper.java:269)
at com.aiming.lfs.billing.BillingProcessor.setupBilling(BillingProcessor.java:64)
at com.aiming.lfs.billing.BillingProcessor.initialize(BillingProcessor.java:38)
at com.aiming.lfs.LFSActivity.onCreate(LFSActivity.java:89)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |