Java syntax error tokens -
package test; public class test { public static void main(string[] args){ system.out.println(" _______________\n"); system.out.println(" .--h--.| |\n"); system.out.println(" _//_|| || Παγωτά |\n"); system.out.println("[ -| |'--;--------------'\n "); system.out.println(" '-()-()----()"()^^^^^^^()"()' "); } } i have have problem at:
system.out.println(" '-()-()----()"()^^^^^^^()"()' "); exception:
exception in thread "main" java.lang.error: unresolved compilation problems: syntax error on token "" \'-()-()----()"", invalid name syntax error on tokens, delete these tokens @ test.test.main(test.java:11) can me?? how solve prob??
" special in java, because represents start or end of string. if want print need escape \", use
system.out.println(" '-()-()----()\"()^^^^^^^()\"()' "); also don't need \n @ end of strings since printing each line using println adds line separator after printed string you.
Comments
Post a Comment