GIAC Secure Software Programmer – Java GSSP-Java Question # 7 Topic 1 Discussion

GIAC Secure Software Programmer – Java GSSP-Java Question # 7 Topic 1 Discussion

GSSP-Java Exam Topic 1 Question 7 Discussion:
Question #: 7
Topic #: 1

What will happen when you try to compile and execute the following code?

class strconcat {public static void main(String args[])

{String str =" Correct answers";String perc ="a"+"b";System.out.println(80+ '%' + str);}}

Note. The ASCII value of % is 37.


A.

It will compile and execute successfully and will print 80 Correct answers as the output.


B.

It will compile and execute successfully and will print 117 Correct answers as the output.


C.

It will compile and execute successfully and will print 80% Correct answers as the output.


D.

It will fail to compile because % cannot be concatenated to a string.


Get Premium GSSP-Java Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.