+ 2
In Java if I have to print a statement with double slash (//) OR use it anywhere in the code how will I do it ?
If I have to use the double slash (//) NOT for a comment ,like example I have to print a statement having two slash (//) it becomes a comment which I don't want. How will I get the two // without it becoming a comment?
7 Respostas
+ 11
System.out.println("/"+"/");
+ 1
oh thanks @Blightedsage
0
it won't work.-_- what if I have to use it in the code not a print statement!?
0
still won't work
0
@ValentinHacker it won't work type it in a program it comes as an error.
- 1
system.out.println (@"//stuff"); should work
I havent used Java for a while.
- 2
Looks like this is a bug in Sololearn's online java compiler. Placing // in a string in my compiler over here yields no error.