← Mastercard questions
Reported in a candidate post, Sep 2024

Static method on a null object and creating an object of a class inside its own method

Filed under Mastercard

Java questions: can a static method be called through a null reference, and when is it acceptable to instantiate a class inside one of its own methods?

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Mastercard questions

Collected from public candidate posts and coding forums. Updated Nov 2026.