A
A
Artem Melnykov2019-07-07 15:55:46
Java
Artem Melnykov, 2019-07-07 15:55:46

How to pass an argument without parentheses?

I am writing code:

public class Program
{
       static void println(String x) {
           System.out.println(x);
        }
  public static void main(String[] args) {
    
  }
}

How can I pass the x argument without parentheses, like println "HI";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-07-07
@NickProgramm

No, printlnit's a method, not an operator. The method without parentheses cannot be called.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question