Adblock breaks this site

Spent the last 30 minutes debugging this tiny lil sucka.

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

  1. CruZr

    CruZr Apprentice
    Banned

    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  2. Timestamp

    Timestamp Guest

    Referrals:
    0
    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.
     
  3. CruZr

    CruZr Apprentice
    Banned

    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  4. xxthebeastxx

    xxthebeastxx Guru
    Banned

    Joined:
    May 17, 2008
    Posts:
    1,680
    Referrals:
    1
    Sythe Gold:
    0
    Spent the last 30 minutes debugging this tiny lil sucka.

    lolya, If you don't know syntax errors take forever.
     
  5. SuF

    SuF Legend
    Pirate Retired Global Moderator

    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
    Spent the last 30 minutes debugging this tiny lil sucka.

    lol, yep... me guessing vb .net syntax takes quite a long time...
     
  6. Stuart

    Stuart Guru
    Banned

    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10
    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.
     
  7. SuF

    SuF Legend
    Pirate Retired Global Moderator

    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
    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...)");
    		}
    	}
    }
    
     
  8. Stuart

    Stuart Guru
    Banned

    Joined:
    May 5, 2005
    Posts:
    1,580
    Referrals:
    2
    Sythe Gold:
    10
    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.
     
  9. SuF

    SuF Legend
    Pirate Retired Global Moderator

    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
    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
     
  10. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    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.
     
  11. SuF

    SuF Legend
    Pirate Retired Global Moderator

    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
    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
     
  12. CruZr

    CruZr Apprentice
    Banned

    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  13. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    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.
     
  14. SuF

    SuF Legend
    Pirate Retired Global Moderator

    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
    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..
     
  15. CruZr

    CruZr Apprentice
    Banned

    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  16. xxthebeastxx

    xxthebeastxx Guru
    Banned

    Joined:
    May 17, 2008
    Posts:
    1,680
    Referrals:
    1
    Sythe Gold:
    0
    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.
     
  17. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    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.
     
  18. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    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.
     
  19. CruZr

    CruZr Apprentice
    Banned

    Joined:
    Aug 9, 2008
    Posts:
    969
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  20. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    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 >


 
 
Adblock breaks this site