Which command-line invocations will compile?

Given:

1. public class Mule {
2. public static void main(String[] args) {
3. boolean assert = true;
4. if(assert) {
5. System.out.println(“assert is true”);
6. }
7. }
8. }

Which command-line invocations will compile?

Given:

1. public class Mule {
2. public static void main(String[] args) {
3. boolean assert = true;
4. if(assert) {
5. System.out.println(“assert is true”);
6. }
7. }
8. }

Which command-line invocations will compile?

A.
javac Mule.java

B.
javac -source 1.3 Mule.java

C.
javac -source 1.4 Mule.java

D.
javac -source 1.5 Mule.java

Explanation:



Leave a Reply 1

Your email address will not be published. Required fields are marked *