# I CAN'T FIND THE ERROR!

Page 1 of 1

## 10 Replies - 602 Views - Last Post: 23 November 2009 - 09:08 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=140893&amp;s=9ba3d19759332fa60252c5952183a94c&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 alexandra1_1_1

Reputation: 0
• Posts: 26
• Joined: 03-May 09

# I CAN'T FIND THE ERROR!

Posted 22 November 2009 - 05:33 PM

```public class Exigently <E1, E2, E3, E4> {
private E1 e1;
private E2 e2;
private E3 e3;
private E4 e4;

Exigently(E3 v3, E1 v1, E4 v4, E2 v2) {
e1 = v1;
e2 = v2;
e3 = v3;
e4 = v4;
}

public E2 unerected(E1 arg) {
c = true;
return e2;
}
public static boolean c = false;
}
```

```class Leprology {}
```

```class Aerogram {}
```

```class Trepang {}
```

```class Decimate{}
```

```public class Bridling{
public static  Decimate clinoaxis() {

Aerogram a =new Aerogram();
Leprology l=new Leprology();
Trepang t=new Trepang();
Decimate d=new Decimate();
Exigently <Aerogram,Leprology,Trepang,Decimate> xa;
d=unerected(Leprology);
return Decimate d;

}
}

```

Is This A Good Question/Topic? 0

## Replies To: I CAN'T FIND THE ERROR!

### #2 macosxnerd101

• Self-Trained Economist

Reputation: 9044
• Posts: 33,555
• Joined: 27-December 08

## Re: I CAN'T FIND THE ERROR!

Posted 22 November 2009 - 05:41 PM

The error lies in this class:
```public class Bridling{
public static  Decimate clinoaxis() {

Aerogram a =new Aerogram();
Leprology l=new Leprology();
Trepang t=new Trepang();
Decimate d=new Decimate();
Exigently <Aerogram,Leprology,Trepang,Decimate> xa;
d=unerected(Leprology);
return Decimate d;

}
}

```

As you can see, the method unerected doesn't exist in this class. To use it, you have to call it from your Exigently object. However, you first have to initialize your Exigently object. Next, unerected is expected a variable of type E1, or in this case, Leprology, not the type itself. So you could pass the variable l, but not Leprology. Next, since d has been declared as a Decimate variable, you can just say return d;

If you did, however, need to return a new object, you would return it like so:
```//replace Type with a valid Reference datatype
return new Type(); //for no-args constructor
return new Type(params); //for constructor w/params

```

### #3 japanir

• jaVanir

Reputation: 1010
• Posts: 3,025
• Joined: 20-August 09

## Re: I CAN'T FIND THE ERROR!

Posted 22 November 2009 - 05:45 PM

it is hard to say without seeing the full code, anyway, at first glance the errors are because the code in Bridling class
this code is wrong. you should call a method of class A from the scope of class B by referring the class A object.
``` d=unerected(Leprology);

```

when not inside the class scope, you should call an object method as:
```//the right way:
Exigently exObj = new Exigently(a,l,t,d);
d = exObj.unerected(l);

```

when creating a new object of Exigently, pass the variable's names, and not their dataTypes.

another problem:
```return Decimate d;

```

no need to mention the type, it should be:
```the right way:
return d;

```

fix the code as i suggested. post if you have other problems

### #4 pbl

• There is nothing you can't do with a JTable

Reputation: 8032
• Posts: 31,202
• Joined: 06-March 08

## Re: I CAN'T FIND THE ERROR!

Posted 22 November 2009 - 08:36 PM

No wonder you can't find the error !!! Your code is an HORROR !!!

Use meaningful variable/class names THIS IS scandalous

This post has been edited by pbl: 22 November 2009 - 08:41 PM

### #5 alexandra1_1_1

Reputation: 0
• Posts: 26
• Joined: 03-May 09

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 07:55 AM

japanir, on 22 Nov, 2009 - 04:45 PM, said:

it is hard to say without seeing the full code, anyway, at first glance the errors are because the code in Bridling class
this code is wrong. you should call a method of class A from the scope of class B by referring the class A object.
``` d=unerected(Leprology);

```

when not inside the class scope, you should call an object method as:
```//the right way:
Exigently exObj = new Exigently(a,l,t,d);
d = exObj.unerected(l);

```

when creating a new object of Exigently, pass the variable's names, and not their dataTypes.

another problem:
```return Decimate d;

```

no need to mention the type, it should be:
```the right way:
return d;

```

fix the code as i suggested. post if you have other problems

Quote

one more question....i think there is problem with the return type..compiler make errors with incompatible types...

### #6 macosxnerd101

• Self-Trained Economist

Reputation: 9044
• Posts: 33,555
• Joined: 27-December 08

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 08:14 AM

Have you just tried returning d as Japanir and I have been suggesting, like so:
```return d;

```

### #7 alexandra1_1_1

Reputation: 0
• Posts: 26
• Joined: 03-May 09

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 08:30 AM

[indent]

macosxnerd101, on 23 Nov, 2009 - 07:14 AM, said:

Have you just tried returning d as Japanir and I have been suggesting, like so:
```return d;

```

```public class Bridling{
public static Decimate clinoaxis() {

Aerogram a =new Aerogram();
Leprology l=new Leprology();
Trepang t=new Trepang();
Decimate d1=new Decimate();
Decimate d2=new Decimate();
Exigently exObj = new Exigently(a,l,t,d1);
d2 = exObj.unerected(l);
return d2;
}

```
[quote]i have do this but i have problems with compiler..

### #8 macosxnerd101

• Self-Trained Economist

Reputation: 9044
• Posts: 33,555
• Joined: 27-December 08

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 08:39 AM

Please respect rule #6 of this forum. If you want to ignore it, then you will get little to no help. It states:

Quote

"Problems with my compiler" is extremely vague as it can produce 1 or 1000 errors.

### #9 alexandra1_1_1

Reputation: 0
• Posts: 26
• Joined: 03-May 09

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 08:52 AM

macosxnerd101, on 23 Nov, 2009 - 07:39 AM, said:

Please respect rule #6 of this forum. If you want to ignore it, then you will get little to no help. It states:

Quote

"Problems with my compiler" is extremely vague as it can produce 1 or 1000 errors.

[quote]ok..you have right..sorry
found : java.lang.Object
required: Decimate
d = exObj.unerected(l);
when i try to run it i have this output from compile

### #10 alexandra1_1_1

Reputation: 0
• Posts: 26
• Joined: 03-May 09

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 09:07 AM

[quote name='alexandra1_1_1' date='23 Nov, 2009 - 07:52 AM' post='843289']

macosxnerd101, on 23 Nov, 2009 - 07:39 AM, said:

Please respect rule #6 of this forum. If you want to ignore it, then you will get little to no help. It states:

Quote

"Problems with my compiler" is extremely vague as it can produce 1 or 1000 errors.

Quote

ok..you have right..sorry
found : java.lang.Object
required: Decimate
d = exObj.unerected(l);
when i try to run it i have this output from compile

### #11 Dophert

Reputation: 10
• Posts: 60
• Joined: 19-October 09

## Re: I CAN'T FIND THE ERROR!

Posted 23 November 2009 - 09:08 AM

alexandra1_1_1, on 23 Nov, 2009 - 07:52 AM, said:

ok..you have right..sorry

```   found   : java.lang.Object
required: Decimate
d = exObj.unerected(l);

```

when i try to run it i have this output from compile

```d = (Decimate)exObj.unerected(l);
```

But you should just add a type to your E1, E2, E3 and E4. :s

```public class Bridling{
public static Decimate clinoaxis() {
Aerogram a = new Aerogram();
Leprology l = new Leprology();
Trepang t = new Trepang();
Decimate d1 = new Decimate();
Decimate d2 = new Decimate();
Exigently<Aerogram, Leprology, Trepang, Decimate> exObj = new Exigently<Aerogram, Leprology, Trepang, Decimate>(a,l,t,d1);
d2 = exObj.unerected(l);
return d2;
}
}

```

EDIT: Quick thinking told me that isn't going to work, ever. You're mixing Leprology with Decimate, you're returning Leprology class when you need a Decimate, you're not extending one another. You need to remake your whole code completely.

This post has been edited by Dophert: 23 November 2009 - 09:11 AM