fr

Daily Challenge 🗓️

Your daily dose of technical intelligence to shine in (developer) society.

Discover a software development quiz per day with its detailed correction.

Frontend, Backend, Mobile, Data, Web, AI, Infra... Everything that can be coded!

Thursday 23 July 2026

-

Java

Java #42/76

What is the output of executing the following code?

public class Main {
	public static void main(String[] args) {
		Main m = null;
	    m.printM();
	}
	public static void printM() {
	    System.out.println("Yes!");
	}
}
Author: W3D TeamStatus: PublishedQuestion passed 208 times
0
Reviews from developers
developer avatar
Incorrect answer
Auteur anonyme
01/06/2024
la bonne réponse est qu'une exception de type NullPointerException sera lancée
developer avatar
Auteur anonyme
04/06/2024
il n' y aura pas de NullPointerException car la mèthode printM() est "static".
developer avatar
Auteur anonyme
05/06/2024
Tu as raison Fodie je ne l'avais pas remarqué 👍

About Daily Challenge 🗓️

From Monday to Friday, discover each day a quiz question with its detailed answer to enrich your tech knowledge. The questions are proposed by the WeLoveDevs.com community: experienced developers, trainers and freelancers.WeLoveDevs.com helps developers to find their dream job. We also provide over 50 free technical tests in different technologies for those of you who would like to test your knowledge.

History

⚠️
Your browser is badly|not supported!
We recommend you to use a more modern browser such as Edge, Chrome or Firefox
Know More