IntClass number = new IntClass(console.nextInt());
It's giving me a compile error:
symbol : class IntClass
location: class Factor
IntClass number = new IntClass(console.nextInt());
I'm writing a program to factor numbers and I figured to it elegantly would be recursive. Btw, does IntClass autounbox the way Integer does?
Name:
Anonymous2008-02-23 17:44
*to do it elegantly
This is not homework just so you know. I made a method for the euclidean algorithm for my fraction class homework that was due, and now I'm going on a number theory craze.
In highschool we were learning Pascal. Not wanting to associate myself with BEGIN BEGIN END BEGIN END END, I told my teacher that I will work in Haskell instead. She was reluctant at first, but later, after she saw my Haskell skils, she was impressed. I had the right to use Haskell in place of Pascal from that time on.
Name:
Anonymous2008-02-23 17:47
>>3
I'm actually just a mathematics major that's bored because of shitty weather. Sigh. I never come to /prog/ so I figured why not. But if you want to just sage, go read the SICP and get back to me.
Name:
Anonymous2008-02-23 17:48
>>4
Ahhh the kids in the what.cd irc #math channel use Haskell on a bot.
Is it plugged in (class imported, signatures compatible)?
Name:
Anonymous2008-02-23 18:20
OH IM SAGING SAGING SAGING MY OWN THREAD
DE DOO DAA DEE DA DOO DAAAAAA
OH IM SAGING SAGING IM SAGING MY OWN THREAD
DE DOO DAA DEE DA DOO DAAAAAA
OH IM SAGING MY THREAD BECAUSE I WANT IT TO BE DEAD
OOOH YEAH
Name:
Anonymous2008-02-23 18:32
>>13
This made me lol so much. >>12
IntClass is a part of javalang or so I thought.
Wow, my java book uses it and mentions NOTHING about importing shit.
"JAVA PROGRAMMING: From Problem Analysis to Program Design: D.S. Malik"
Is there a way to call by reference on primitive data types besides creating this object or is this the right way to do it (seems weird that the right way involves importing);
Name:
Anonymous2008-02-23 18:44
If console.nextInt() returned an IntClasss there'd be no need to do copy-construction; if IntClass has a constructor from int, then passing an int by value is fine.
>>18-25
Same person and we have been trolled constantly.
Name:
Anonymous2008-02-23 22:19
>>1
Elegant and recursive don't mix outside of functional languages. Especially not in Java, since it has a shaky grasp on what ``environment'' means, so it'll push way too much junk onto the stack.
Also, why the fuck would you use a wrapper for int, and given that you're using a wrapper, why the fuck wouldn't you use Integer, which exists under java.lang?
Name:
Anonymous2008-02-25 19:17
Don't mind about them, that's just the Sussman trolling us.