Re: Run-time Error in array of Object program Netbeans IDE 14 Ubuntu 18.04

2022-07-03 Thread Pieter van den Hombergh
with the setting from my previous mail. Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.mycompany.add2strjop.Employee.getEmpName()" because* "arr[i]" is null* at com.mycompany.add2strjop.Add2StrJOp.showRecords(Add2StrJOp.java:84) at com.mycompany.add2strjop.Add2StrJOp.

Re: Run-time Error in array of Object program Netbeans IDE 14 Ubuntu 18.04

2022-07-03 Thread Pieter van den Hombergh
You declare an array 0f 10 elements, but fill only three. The 4th element (at position 3) is still null, that is where you get you null pointer. Maybe it is a good time to: 1. switch to java 17 which has better error messages for null pointers when you start it with -XX:+ShowCodeDetailsInExceptio

Re: Run-time Error in array of Object program Netbeans IDE 14 Ubuntu 18.04

2022-07-01 Thread Laszlo Kishalmi
On 7/1/22 16:32, Zulfi Khan wrote: Exception in thread "main" java.lang.NullPointerException at com.mycompany.add2strjop.Add2StrJOp.showRecords(Add2StrJOp.java:41)

Run-time Error in array of Object program Netbeans IDE 14 Ubuntu 18.04

2022-07-01 Thread Zulfi Khan
Hi, I am getting arun-time error in the following program,using Netbeans ID: 14, ubuntu18.04: /* * Clicknbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txtto change this license * Clicknbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${pa