Does java have an equivalent operator or language construct as the verbatim operator(@) in C#?
Does java have an equivalent operator or language construct as the verbatim operator(@) in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Quick Googling tells me that verbatim operator in C# is apparently just syntactic sugar.
No, there’s no equivalent in Java. Java isn’t about syntactic sugar, the main focus of Java as a language is to provide only one way to perform or otherwise get a single function, that’s why each reserved word in Java has only one function and a lot of syntactic sugar is missing. Just to emphasise, @ is already reserved for annotations.
While the benefits and shortcomings of this can be discussed to eternity, the bottom line is that Java is really sparse in syntactic sugar, in fact only syntactic sugar in Java I can think of is the enhanced
forloop and even then internally JVM knows only ofwhileloops, anyway.