Is this a freakin joke?!

This is a discussion on Is this a freakin joke?! within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I decided to try my hand at java.....so far i'm not impressed....i just spent the last hour trying to figure ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    719

    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?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    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.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    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"
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  4. #4
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    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

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    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?
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  6. #6
    ---
    Join Date
    May 2004
    Posts
    1,379
    >> 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?

  7. #7
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    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

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    commando -> command line
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  9. #9
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I did it! I freakin did it!
    By misplaced in forum Tech Board
    Replies: 7
    Last Post: 04-21-2005, 11:49 PM
  2. Joke
    By Stinky in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-06-2003, 03:35 PM
  3. couldn't resist a joke
    By Penlan in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-30-2003, 09:19 AM
  4. Time for another joke thread?
    By C_Coder in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 05-16-2002, 11:29 AM
  5. Edited Joke
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-12-2001, 12:11 PM

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