Question: 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
 A+ Computer Science - Writing Classes Worksheet 1 DIRECTIONS : Fill

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!