Computer Science, asked by abinshajiabin2006, 6 months ago

write a java statement to create two objects of class 'Toy' named 'Soft toy' 'Electronic toy'

Answers

Answered by ArpitMishra506
7

Toy SoftToy = new Toy();

Toy ElectronicToy = new Toy();

.

.

.

.

HOPE THIS HELPS YOU

.

.

.

.

PLEASE MARK AS BRAINLIEST AND FOLLOW ME TOO

Answered by anindyaadhikari13
6

Question:-

Write a Java statement two create two object of class 'Toy' named 'Soft toy' and 'Electric toy'

Statement:-

Toy SoftToy = new Toy();

Toy ElectricToy=new Toy();

Note:-

The new keyword is used to create objects of the class.

Similar questions