Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Kenishi
Nov 18, 2010
I've been working some Java alg exercises on paper and I've just had a brainfart.

code:
// Node are single linkedlist nodes
// Assume less and cur are valid.
Node temp = cur.next;
cur.next = less.next;
less.next = cur;
cur = temp;
'cur' will equal cur.next after this all executes. And less.next will still be the old cur value. Correct?

Adbot
ADBOT LOVES YOU

Kenishi
Nov 18, 2010
Java should be easier to learn than python in some respects because Java doesn't handle tuples and lists natively. The only thing that might be hard for someone that only knows Python is the fact that Java is type sensitive. Python uses 'duck typeing' while Java uses explicit declaration of what things have to be. I don't use Python as deeply as it can be used so I can't comment on everything but I do know lambda expressions were recently added to Java 8, so that brings Java closer to what Python can do.

Kenishi
Nov 18, 2010

Volmarias posted:

Java also needs an IDE whereas with Python you really can get away with a smart text editor for a long time. Pick up Eclipse or IntelliJ and spend a little time learning to use it.
I don't know if I'd go so far as to say it needs an IDE, but you'd be incredibly stupid to not be using one.

Most IDEs can check syntax and scope as you type (I assume due to the Just-in-Time compiling nature of Java) so you can catch errors. Also due to the strong Type casting of Java, the IDEs can more easily (and correctly) do intellisense suggestions. Other use for an IDE being that it simplifies the issue of setting up Classpaths for when you build JARs/WARs.

Kenishi fucked around with this message at 01:00 on Jul 14, 2014

Kenishi
Nov 18, 2010
Those are part of the Java standard library. If I have to import the thing to use it then its not natively part of the language. Plus I've always found the manipulation of lists/tuples in Python to be a lot easier than using the Java library ones.

Kenishi
Nov 18, 2010
Anyone familiar enough with SWT to explain how the Region.add(int[] pointArray) works? I'm trying to create a rounded rectangle region for a Shell and am not sure how the size of the array/indexs translate to points.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply