Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

How does one get into do nothing Java?

Asked by Ananya Pawar Oct 12, 2022 2.1K views 1 answer
Share

About this question

In C++ when I wanted to mark that if is empty by design I added NULL; as statement:
if (cond1) {
    ...
} else if (cond2) {
    NULL;
} else {
    ...
}

However in Java it seems to be impossible to have a null; as statement. What is the correct way of marking empty by design if in Java (is it just a comment)?

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.