This is Element class:
Element
public class Element { private String elementName; private int atomicNumber; private String Symbol; priv
Declaring an array like initialises the array object, but not the elements of the array. You need to create an Element object at each index of the array.
element[0] = new Element(); element[0].setElementName("H");