Spent the last 30 minutes debugging this tiny lil sucka.

Discussion in 'Programming General' started by CruZr, Nov 30, 2008.

Spent the last 30 minutes debugging this tiny lil sucka.
  1. Unread #1 - Nov 30, 2008 at 11:03 PM
  2. CruZr
    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0

    CruZr Apprentice
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    I'm slowly progressing.



    Code:
    public class lol {
    
    public static void main(String[] args) {
    	
    int aBalmung = 1337;
    
    System.out.println("Balmung is " + aBalmung);
    }
    
    }

    I don't use an IDE so I am finding the errors by myself, so it takes a while as I SUCK at java.
     
  3. Unread #2 - Nov 30, 2008 at 11:07 PM
  4. Timestamp
    Referrals:
    0

    Timestamp Guest

    Spent the last 30 minutes debugging this tiny lil sucka.

    This shouldn't have taken you more than two minutes.
    I really do hope this was a joke.
     
  5. Unread #3 - Nov 30, 2008 at 11:18 PM
  6. CruZr
    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0

    CruZr Apprentice
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    No, the fact is I suck ass at programming in java.
    I have no clue about the meaning of anything in error when compiling, so if it didn't compile I rewrote it.

    I are a massive noob.
     
  7. Unread #4 - Dec 1, 2008 at 12:39 AM
  8. xxthebeastxx
    Joined:
    May 17, 2008
    Posts:
    1,680
    Referrals:
    1
    Sythe Gold:
    0

    xxthebeastxx Guru
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    lolya, If you don't know syntax errors take forever.
     
  9. Unread #5 - Dec 1, 2008 at 7:32 AM
  10. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    lol, yep... me guessing vb .net syntax takes quite a long time...
     
  11. Unread #6 - Dec 1, 2008 at 8:17 AM
  12. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    Nope .net is easy :)

    Gratz on writing your first java program keep on at it. Once you have wrote a few programs it becomes alot easier(duh).

    Look up scanners they are used for user input.
     
  13. Unread #7 - Dec 1, 2008 at 8:54 AM
  14. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    This program uses easier way of getting input, and demonstrates how to see if strings equal something... D:

    Code:
    import javax.swing.JOptionPane;
    
    public class Tester
    {
    	public static void main(String[] arg)
    	{
    		String name = JOptionPane.showInputDialog("Enter your name:");
    		
    		if(name.equalsIgnoreCase("SuF"))
    		{
    			System.out.println("You are cool, but only guesses at VB .net shit, and fails at it!");
    		}
    		else if(name.equalsIgnoreCase("Stuart"))
    		{
    			System.out.println("You are NOT cool, but you own at VB .net!!!!! (Meaning your cool!)");
    		}
    		else
    		{
    			System.out.println("Ummmm, you fail... (Well, I dunno who in fuck you are, but I can guess you fail...)");
    		}
    	}
    }
    
     
  15. Unread #8 - Dec 1, 2008 at 9:25 AM
  16. Stuart
    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10

    Stuart Guru
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    =. lol nice example...

    Sure you can use swing but I was only suggesting a command prompt version because thats what he's doing at the moment. Sort of a running before learning to walk type thing.
     
  17. Unread #9 - Dec 1, 2008 at 10:40 AM
  18. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    I learned the console way, but using the swing window is 1 line of code and it works well... either way... scanner r annoying... lol
     
  19. Unread #10 - Dec 1, 2008 at 11:30 AM
  20. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    What are you talking about? Scanners are easy, you just need to declare the Scanner object first.
     
  21. Unread #11 - Dec 1, 2008 at 11:51 AM
  22. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    And its annoying... I hate writing out scanner object declarations... I don't know why... :p
     
  23. Unread #12 - Dec 1, 2008 at 5:31 PM
  24. CruZr
    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0

    CruZr Apprentice
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    lolya I found that out :D
    Ouch, I dabbled in VB6, I quickly went to java.
    Yeah, afetr like 3 times of getting printline commands done correctly I can do it on first try no error.
    Sad I'm happy about that :D
    Hoping same goes for more complex objects such as learning GUI or soemthing besides working through CMD :p
    Thank you very much for an example I can learn from, user input was soemthing was about to look up because I remember writing a quiz for an old private server from cheatscene by the awesomeness that is Terry. (SuF I remember you from CS xD), and was hoping to make a quiz in java for another game I play.

    I r lost :p

    Nubs ftw.
     
  25. Unread #13 - Dec 1, 2008 at 5:50 PM
  26. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    You don't need an IDE to point out your errors... when you use "javac" to compile it, it should print out all the errors to the console anyways.
     
  27. Unread #14 - Dec 1, 2008 at 8:57 PM
  28. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    yea but, its easier to understand a thing with a red line under it that a bunch of text... a bit faster..
     
  29. Unread #15 - Dec 1, 2008 at 9:37 PM
  30. CruZr
    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0

    CruZr Apprentice
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    Yeah, with javac it doesn't tell you exactly what the error is.

    Like NoClassDefFound(Like 4 more lines of error.) could be summed up in.
    "You don't need to put .class at the end of 'Java lol.class!'"

    IDE's underline what is wrong and the better ones actually tell you how to fix it.

    But IMO if I learn what the errors mean by myself without an IDE I'll be better off in the future.
     
  31. Unread #16 - Dec 3, 2008 at 12:38 AM
  32. xxthebeastxx
    Joined:
    May 17, 2008
    Posts:
    1,680
    Referrals:
    1
    Sythe Gold:
    0

    xxthebeastxx Guru
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    Oh yea

    public class lol {

    could be:

    class lol {

    there is no need to declare it public.
     
  33. Unread #17 - Dec 3, 2008 at 12:55 AM
  34. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Spent the last 30 minutes debugging this tiny lil sucka.

    For the sake of good programming, it is best to use the modifiers, even if typing up "public" is redundant. Just helps people to identify what is going on in the long run.
     
  35. Unread #18 - Dec 3, 2008 at 1:03 AM
  36. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Spent the last 30 minutes debugging this tiny lil sucka.

    Actually, it's usually pretty specific in pointing out what the error is. If you can't comprehend the compiler's description of it you should quickly perform a search on the internet for the error's keywords.

    All you had to do was go to Google, type in "NoClassDefFound", click search, and be brought to this site as the first result. The site NOT ONLY explains what a NoClassDefFound error means, it EVEN implicitly uses your problem case as an example of what can cause it. So you could have solved this on your own in a matter of seconds.
     
  37. Unread #19 - Dec 10, 2008 at 7:07 PM
  38. CruZr
    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0

    CruZr Apprentice
    Banned

    Spent the last 30 minutes debugging this tiny lil sucka.

    That's not me figuring it out.
    That's some guy that made the website telling me.
     
  39. Unread #20 - Dec 11, 2008 at 8:32 AM
  40. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    Spent the last 30 minutes debugging this tiny lil sucka.

    Well you aren't going to get any better at Java programming by just staring at a few lines of code for 30 mins. Don't waste your time, just use an IDE.
     
< What exactly can you make with these programming languages? | JDK Problem >

Users viewing this thread
1 guest


 
 
Adblock breaks this site