• Log in or sign up for an account here: https://www.sythe.org/login

Spent the last 30 minutes debugging this tiny lil sucka.

CruZr

Apprentice

Banned
Joined
Aug 9, 2008
Sythe Gold
0
Messages
969
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.
 
This shouldn't have taken you more than two minutes.
I really do hope this was a joke.
 
This shouldn't have taken you more than two minutes.
I really do hope this was a joke.

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.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
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.

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...)");
		}
	}
}
 
=. 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.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
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
 
Member of the Month Winner
Sythe's 10th Anniversary
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
What are you talking about? Scanners are easy, you just need to declare the Scanner object first.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
What are you talking about? Scanners are easy, you just need to declare the Scanner object first.

And its annoying... I hate writing out scanner object declarations... I don't know why... :P
 
lolya, If you don't know syntax errors take forever.
lolya I found that out :D
lol, yep... me guessing vb .net syntax takes quite a long time...
Ouch, I dabbled in VB6, I quickly went to java.
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.
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
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...)");
		}
	}
}
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 learned the console way, but using the swing window is 1 line of code and it works well... either way... scanner r annoying... lol
I r lost :P

Nubs ftw.
 
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.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
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.

yea but, its easier to understand a thing with a red line under it that a bunch of text... a bit faster..
 
yea but, its easier to understand a thing with a red line under it that a bunch of text... a bit faster..

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.
 
Member of the Month Winner
Sythe's 10th Anniversary
Oh yea

public class lol {

could be:

class lol {

there is no need to declare it public.
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.
 
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!'"
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.
 
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.

That's not me figuring it out.
That's some guy that made the website telling me.
 
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.
 
Runescape Gamblingrunescape gambling
Back
Top