Declarations and Access Control Logic
© examsiri.com
Question : 19 of 29
Marks:
+1,
-0
Replace two of the Modifiers that appear in the Single class to make the code compile. Note: Three modifiers will not be used and four modifiers In the code will remain unchanged.
Code:
Modifiers:
final
protected
private
abstract
static
Code:
public class Single {
private static Single instance;
 public static Single getInstance(){
  if(instance== null) instance = create();
  return instance;
 }
 private Single(){}
 protected Single create() { return new Single();}}
class SingeSub extends Single{
}Modifiers:
final
protected
private
abstract
static
Go to Question: