Given the code fragment:
Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)
Given the code fragment:
Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)
To print 'Mondial:domainmodel', the code must concatenate the 'prefix' static field and the 'name' instance field. Option C works because it correctly uses the static 'prefix' field and calls the static 'getName()' method which returns the 'name' field from a new Main instance. Option D works because it creates a new instance of Main to access both 'prefix' and 'name' fields directly, ensuring it uses their values properly.
C & D are correct TESTED
C - access to private modifier inside the class is Ok (doesn't matter which instance)
Correct answer is C & D