أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
When you see "NullPointException", it means that you are using a variable that is not instantiated.
Any Java variable you declare, then instantiate by the 'new' keyword, will "point" to a location in memory. It is a reference to this location. NullPointerException is just a name, it could be anything. When you try to use a variable which is NOT YET instantiated, it points nowhere and can do noting. hence the exception.