logo

Crowdly

Browser

Add to Chrome

// Course.java package unit01.quiz; public enum Course { ARTIFICIA...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

// Course.java

package unit01.quiz;

public enum Course {

ARTIFICIAL_INTELLIGENCE(536), COMPUTER_SCIENCE(521), BUSINESS_INFORMATICS(526);

private int id;

private Course(int id) {

this.id = id;

}

}

// Main.java

package unit01.quiz;

public class Main {

public static void main(String[] args) {

Course course = Course.BUSINESS_INFORMATICS;

}

}

Which statements (in main()) will print "BUSINESS_INFORMATICS" to the terminal?

1) System.out.println(BUSINESS_INFORMATICS);

2) System.out.println(course);

3) System.out.println(Course.BUSINESS_INFORMATICS);

4) System.out.println(course.toString());

5) System.out.println(course.name());

6) System.out.println(course());

7) System.out.println(Course(3));

8) System.out.println(Course.values()[course.ordinal()]);

More questions like this

Want instant access to all verified answers on moodle.jku.at?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome