Multiple choice technology web technology

IF We Save our JAvA Class without the specified class name.Then what will happen

  1. Compilation Error

  2. Run time Error

  3. BOTH

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In Java, a public class name must match the filename. If you save a class with a different name than specified, the compiler will fail with a compilation error. The code won't even reach runtime.