In Java If you use string instead of string single quotes in

In Java,

If you use \'string\' instead of \'\'string\'\'

(single quotes instead of double)

What kind of error is that: lexical or syntactic?

Solution

Its a LEXICAL Error in JAVA as double quotes are used when we enter any string and single quotes are only used for single characters like \'a\', \'J\' etc. Lexical errors are the errors thrown by your lexer when unable to continue.

In Java, If you use \'string\' instead of \'\'string\'\' (single quotes instead of double) What kind of error is that: lexical or syntactic?SolutionIts a LEXICA

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site