Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the file Dril 1 2 . java, add the following class definitions ( you can copy / paste them from here ) : class

In the file Dril12. java, add the following class definitions (you can copy/paste them from here):
class C1{
C2 other;
C1( C2 other){
this. other = other;
}
}
class C2{
int x;
double y;
C2(int x, double y){
this. x=x;
}
this. y=y;
}
Then add a class definition called Drill2 with the following fields:
A field named first of type C2 with its x field equal to 10, and y field should be 3.5
A field named second of type C1. It's value should be a reference to a C1 object with its other field set to any C2 object other than the one stored in first (you can create another C2 object for this).
A field named third of type C1. It's value should be a reference to a C1 object with its other field the same C2 object as the one stored in the first field.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago