C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 05-02-2005, 03:33 AM   #1
Registered User
 
Join Date: Sep 2004
Posts: 720
Is this a freakin joke?!

I decided to try my hand at java.....so far i'm not impressed....i just spent the last hour trying to figure out why my button wasn't showing up in the window.. everything compiled fine, without any warning....still, no button.........

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(){...} 
}
what's wrong with this picture?


should i expect a lot more of this out of java?
__________________
Quote:
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
misplaced is offline   Reply With Quote
Old 05-02-2005, 04:33 AM   #2
Confused
 
Magos's Avatar
 
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   Reply With Quote
Old 05-02-2005, 05:08 AM   #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:
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
misplaced is offline   Reply With Quote
Old 05-02-2005, 05:46 AM   #4
Registered User
 
axon's Avatar
 
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   Reply With Quote
Old 05-02-2005, 06:10 AM   #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:
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
misplaced is offline   Reply With Quote
Old 05-02-2005, 06:32 AM   #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   Reply With Quote
Old 05-02-2005, 06:56 AM   #7
Registered User
 
axon's Avatar
 
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   Reply With Quote
Old 05-02-2005, 07:04 AM   #8
Registered User
 
Join Date: Sep 2004
Posts: 720
commando -> command line
__________________
Quote:
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
misplaced is offline   Reply With Quote
Old 05-02-2005, 07:07 AM   #9
Registered User
 
axon's Avatar
 
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   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 04:30 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22