Page 1 of 1

14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.pr

Posted: Fri May 20, 2022 11:30 am
by answerhappygod
14 Specify The Error In Following Program Public Enum Enums North South West East Private Enums System Out Pr 1
14 Specify The Error In Following Program Public Enum Enums North South West East Private Enums System Out Pr 1 (58.17 KiB) Viewed 30 times
14.Specify the error in following program? public enum Enums { NORTH, SOUTH, WEST, EAST; private Enums() { System.out.println(1): } } class MainClass { public static void main(String[] args) { Enums dl = new Enums(); } } O a. Have duplicate constants. O b. Have only private constructors. c. Did not declare enum constants with any modifiers O d. Using 'new' operator.

A class in java is a blueprint (template) that consists of instance variables, instance methods, and constructors. Objects are instances/copies of a class. Therefore, which of the following statements are TRUE? i. The methods that retrieve the data of fields in the class are called accessors ii. The methods that modify the data of fields in the class are called mutators. iii. A class may be declared without constructors. iv. Name of constructor always same as name of class Oi & ii O i & ii & iii & ivv Oiii Oii