What is the output of the following statements: System.out.print ("welcome to"); System.out.println('business" + "college")? JAVA
welcome tobusinesscollege Explanation: ------------- first of all this code has an compilation error. 'business" string must be enclosed in double quotes. but 'business" starts with a single quote. that's the compilation error. let's fix it see what it prints fixed code: ------------ System.out.print ("welcome to"); // this prints welcome to (and no newline after the string) System.out.println("business" + "college"); // this prints businesscollege Note: entire string is printed on a single line.
Get Answers For Free
Most questions answered within 1 hours.