View Full Version : Java
Azathoth
09-25-2009, 03:37
Any of you know Java?
Let me guess you have to learn it at college/uni/school?
Yes. And I will never use it. There's a thread around here about it, I'll try find it.
pevergreen
09-25-2009, 04:33
Mmmm ineffective.
Azathoth
09-25-2009, 04:59
Well, let's say I want to make a method that takes finds the discriminant of three variables that aready exist. Does it matter whether I put public or private?
private void calcDescrim()
{
double f;
f = b*b-4*a*c;
d = sqrt (double f);
}
That last line isn't working. It says it expects a .class. How do I get the square root of f?
Megas Methuselah
09-25-2009, 05:01
I erased this knowledge from my mind ages ago, mah man.
Azathoth
09-25-2009, 05:56
Damn textbooks are wrong. Well, there's a lot more to this assignment and I have plenty of other HW, so I'm just going to stop here. I need help with Java bigtime - hopefully my teacher will have some extra time.
Gah.
Learn another programming language, a REAL one, like C/C++. Ones that will teach you now how to NOT write, horrible, bloated, crappy code, how to do real memory management, etc. Java is utter garbage.
I think you'd need to import the class in your code file for it to just be sqrt(junkhere).
I can see you are already learning some bad habits. Assuming you cut and paste your code in, you need to:
1. COMMENT your code, extensively. Seriously, you should almost have more comments than code.
2. Indent.
3. Use parentheses in your math operation code, NEVER depend on order of operations.
4. Use better variable names.
:balloon2:
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.