write a statement to create an object 'Keyboard' of the class 'Computer'
Answers
Answered by
77
Computer Keyboard = new Computer (...);
The "..." here represent arguments to be passed if the Constructor of the class Computer is parameterized...If not, just neglect those dots !
-TheSavior
The "..." here represent arguments to be passed if the Constructor of the class Computer is parameterized...If not, just neglect those dots !
-TheSavior
Answered by
2
Answer:
Computer Keyboard = new Computer();
Explanation:
Here the class name is Computer and object name is keyboard.
The keyword 'new' is used to create the object.
The keyword 'new' is followed by a call to a constructor. If no such constructer is defined, then the complier supplies the default constructor.
Similar questions