public class Cat
{
    String name;
    int age;
    int weigtht;
    int strength;
}

Task: Create a class Cat. A cat must have its name (name, String), age (age, int), weight (weight, int), and strength (strength, int). Please help shows that :The program has not passed testing.

asked 14 Apr '15, 09:50

Karolis%20Belia%C5%A1as's gravatar image

Karolis Beli...
25310
accept rate: 0%

solved it:)

(14 Apr '15, 10:15) Karolis Beli...

String should be private or public.. Also check ur spelling of weight.

link

answered 22 Apr '15, 19:11

Zain%20Mehar's gravatar image

Zain Mehar
13
accept rate: 0%

edited 22 Apr '15, 19:12

Do assign them values as required.

link

answered 16 Jun '15, 21:00

bhawna28's gravatar image

bhawna28
111
accept rate: 0%

Try to assigned private or public type to all variables. And you have spelled "weight" wrong (weigtht->weight).

link

answered 29 Mar '16, 07:35

ILIA%20KISIL's gravatar image

ILIA KISIL
124
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×30
×24
×15

Asked: 14 Apr '15, 09:50

Seen: 2,686 times

Last updated: 29 Mar '16, 07:35