Computer Science, asked by Harshi666, 1 year ago

write a statement to create an object 'Keyboard' of the class 'Computer'

Answers

Answered by TheIncorporealKlaus
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
Answered by kaushanimisra97
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