![]() |
| | #1 | |
| Registered User Join Date: Sep 2004
Posts: 720
| Is this a freakin joke?! i fixed it, but appearantly, the (sole) constructor which created the button, wasn't getting called..... i had... Code: public class MyClass{
public void MyClass(){...}
}
should i expect a lot more of this out of java?
__________________ Quote:
| |
| misplaced is offline | |
| | #2 |
| Confused Join Date: Sep 2001 Location: Sweden
Posts: 3,125
| You sure you created an instance of the class somewhere? Note that everything (most) is pointers in java so you have to use the new operator, not just this: MyClass c;
__________________ MagosX.com Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. |
| Magos is offline | |
| | #3 | |
| Registered User Join Date: Sep 2004
Posts: 720
| no no...i figured out the problem before i posted here... i posted because i was a bit disgusted that the java compiler let me compile a constructor with a return type and didn't say a word. because it had a return type, the overload didn't get resolved "properly"
__________________ Quote:
| |
| misplaced is offline | |
| | #4 |
| Registered User Join Date: Feb 2003 Location: Mt. Prospect, IL
Posts: 2,603
| from your post it is really not clear what is wrong, and how java is at fault here. Most likely it is your inexperiance with the language that caused the problem and not the language it self. What IDE are you using? and then, are you using awt or swing libraries?
__________________ some entropy with that sink? entropysink.com there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka |
| axon is offline | |
| | #5 | |
| Registered User Join Date: Sep 2004
Posts: 720
| ide = commando i'm using swing, which means i'm also using awt. can a constructor return a value in java? if so, why does Learning Java by O'Reilly say otherwise?
__________________ Quote:
| |
| misplaced is offline | |
| | #6 |
| Registered User Join Date: May 2004
Posts: 1,362
| >> a constructor with a return type I noticed this as soon as I saw it but I have never tried to compile it like that and I don't know if it is technically legal Java code or not. Obviously it is but I'm sure there is a reason for it. Something like that wouldn't go unnoticed easily. Maybe check to see if compiler warnings are turned on? |
| sand_man is offline | |
| | #7 |
| Registered User Join Date: Feb 2003 Location: Mt. Prospect, IL
Posts: 2,603
| i've never even heard of that ide dude; I suggest one of these three: Eclipse, NetBeans, JbuilderX NetBeans has a great GUI builder feature.
__________________ some entropy with that sink? entropysink.com there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka |
| axon is offline | |
| | #8 | |
| Registered User Join Date: Sep 2004
Posts: 720
| commando -> command line
__________________ Quote:
| |
| misplaced is offline | |
| | #9 |
| Registered User Join Date: Feb 2003 Location: Mt. Prospect, IL
Posts: 2,603
| oh, woops in that case, make sure you are using the newest version of java.
__________________ some entropy with that sink? entropysink.com there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka |
| axon is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I did it! I freakin did it! | misplaced | Tech Board | 7 | 04-21-2005 11:49 PM |
| Joke | Stinky | A Brief History of Cprogramming.com | 1 | 11-06-2003 04:35 PM |
| couldn't resist a joke | Penlan | A Brief History of Cprogramming.com | 2 | 03-30-2003 10:19 AM |
| Time for another joke thread? | C_Coder | A Brief History of Cprogramming.com | 9 | 05-16-2002 11:29 AM |
| Edited Joke | Unregistered | A Brief History of Cprogramming.com | 0 | 11-12-2001 01:11 PM |