Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A + Computer Science - Writing Classes Worksheet 1 DIRECTIONS : Fill in each blank with the proper Java code. ( 1 ) class Alligator

A+ Computer Science - Writing Classes Worksheet 1
DIRECTIONS : Fill in each blank with the proper Java code.
(1)
class Alligator
1
private int length;
private double hunger;
public Alligator()
{
}
public Alligator(int len, double hun)
{
(2)
}
public boolean equals(Object obj)
{
(3)
}
public String tostring()
{
(4)
}
}
//////////////////////////////
??? runner code in another class
Alligator gator = new Alligator();
Alligator gatuh = new Alligator (3,4);
out.println ("gator ="+ gator);
out.println ("gatuh ="+ gatuh);
out.println (gator. equals (gatuh));
Alligator mean = new Alligator (3,4);
out.println (mean. equals (gatuh));
OUTPUT
gator =0
0.0
gatuh =3
4.0
false
true
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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

Discuss the importance of linking pay to ethical behavior.

Answered: 1 week ago

Question

Explain how to reward individual and team performance.

Answered: 1 week ago