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
itsasnake
Sep 1, 2007
Okay so very basic coding question here but even after googling and harassing quite a number of people i can't seem to find out how.

How would i iterate through an ArrayList and count how many times each element occurs in the array and produce an answer which will display the element which occured the highest number of times?

Adbot
ADBOT LOVES YOU

mjan
Jan 30, 2007

itsasnake posted:

Okay so very basic coding question here but even after googling and harassing quite a number of people i can't seem to find out how.

How would i iterate through an ArrayList and count how many times each element occurs in the array and produce an answer which will display the element which occured the highest number of times?

Lazy way:

code:
public Object most(List input) {
  Map counter = new HashMap();
  Object most = null;
  Integer highest = new Integer(0);
  for (Iterator i = input.iterator(); i.hasNext();) {
    Object o = i.next();
    Integer count = (Integer)counter.get(o);
    if (count == null) {
     count = new Integer(0);
    }
    counter.put(o, new Integer(count.intValue()+1));
  }
  for (Iterator i = counter.keySet().iterator(); i.hasNext();) {
    Object key = i.next();
    Integer value = (Integer)counter.get(key);
    if(value.compareTo(highest) > 0) {
      most = key;
      highest = value;
    }
  }
  return most;
}
Note that in cases of a tie, the first of a given amount encountered would be the winner. There's almost certainly a more clever way of doing it, most likely after first sorting the List.

itsasnake
Sep 1, 2007
Yeah, i sorted the list into an ArrayList of 1050 elements. Can you elaborate please?

Incoherence
May 22, 2004

POYO AND TEAR

itsasnake posted:

Yeah, i sorted the list into an ArrayList of 1050 elements. Can you elaborate please?
If the list is sorted, then presumably all of the duplicates are together and you're only counting "runs" of a given element as opposed to total occurrences (in other words, you can get rid of the HashMap in his code). Slightly less space taken, slightly worse time bounds (although for 1050 elements it doesn't really matter).

Something like this:
code:
Object current = list.at(0);
int currentCount = 1;
Object max = null;
int maxCount = 0;
for (int i = 1; i < list.size(); i++) {
  Object temp = list.at(i);
  if (temp.equals(current)) {
    currentCount++;
  } else {
    if (currentCount > maxCount) {
      max = current;
      maxCount = currentCount;
    }
    currentCount = 1;
    current = temp;
  }
}
if (currentCount > maxCount) {
  return current;
} else {
  return max;
}

itsasnake
Sep 1, 2007
Thanks, appreciated, i'll go play with that for a bit.

Sterra
Jul 7, 2002

by Peatpot
How does one go about implementing the externalizable interface so that a treelike object can't overflow the stack?

I came across this issue and while realistically it shouldn't affect me I couldn't figure it out.

PuTTY riot
Nov 16, 2002
OK, I know homework questions are frowned upon here, but I just want to make sure I'm on the right track. We are supposed to create a real-world entity, then make a subclass that is a specialized form of that entity. I've got both of those done. (CellPhone and SmartPhone, smart phone having data minutes in addition to regular minutes and all the other stuff cell phone has via super();).

The final part is where I'm getting a little confused. it says 'Illustrate composition by developing a third class that is used by one or both of the first classes[in my case cell/smartphone]'. I'm planning on creating a customer class that 'has-a' cell phone or smart phone. Is this what y'all think he's trying to get us to do? If i create a constructor with a cellphone argument, can I put a smartphone in there?


edit: Okay, I threw the customer class together and I could use either one. I'm pretty sure I'm on the right track, but I'd still greatly appreciate any advice.

PuTTY riot fucked around with this message at 21:41 on Mar 15, 2008

Incoherence
May 22, 2004

POYO AND TEAR

Sterra posted:

How does one go about implementing the externalizable interface so that a treelike object can't overflow the stack?

I came across this issue and while realistically it shouldn't affect me I couldn't figure it out.
If you're really making trees too big for the stack, don't make them recursive, or make them less recursive.

the littlest prince
Sep 23, 2006


American Jello posted:

OK, I know homework questions are frowned upon here, but I just want to make sure I'm on the right track. We are supposed to create a real-world entity, then make a subclass that is a specialized form of that entity. I've got both of those done. (CellPhone and SmartPhone, smart phone having data minutes in addition to regular minutes and all the other stuff cell phone has via super();).

The final part is where I'm getting a little confused. it says 'Illustrate composition by developing a third class that is used by one or both of the first classes[in my case cell/smartphone]'. I'm planning on creating a customer class that 'has-a' cell phone or smart phone. Is this what y'all think he's trying to get us to do? If i create a constructor with a cellphone argument, can I put a smartphone in there?


edit: Okay, I threw the customer class together and I could use either one. I'm pretty sure I'm on the right track, but I'd still greatly appreciate any advice.

If the third class needs to 'be used' by one of the first two, a Customer would 'use' a phone, rather than than a phone 'using' a customer. So you might make a class for a phone number and say that they both 'use' a phone number, or a web browser, which only the smart phone uses. But I doubt that's the important part. I think what you're supposed to understand is the difference between having an instance of a class (customer has a phone), and being an instance of a class (smart phone is a cell phone).

You also might be making this more complex than it really is, because it sounds like you have it down just fine.

PuTTY riot
Nov 16, 2002
See, this is why I came in here for a second opinion. I had the right idea but I misread what he wanted us to do. Went ahead and used the phone number idea, it took some more work than the customer class, but I need an A in this class so I don't really care. Thanks for the help.

ColdPie
Jun 9, 2006

Reflection! And Generics!

I'd like to get the type parameter, as a Class, Type, or even just the canonical name String, used in a generic class. For example, I'd like to get the Class object for java.lang.String from a Vector<String> object, or a Class object for java.lang.Integer from a Vector<Integer> object.

I found the Class.getTypeParameters() method, but the best I can get out of that is a java.lang.Object Type object.

This isn't crucial to my project, so if it's impossible it's impossible. It would really simplify maintenance and documentation if there is a way to get it, though.

Any ideas?

F'Nog
Jul 21, 2001

ColdPie posted:

Reflection! And Generics!

I'd like to get the type parameter, as a Class, Type, or even just the canonical name String, used in a generic class. For example, I'd like to get the Class object for java.lang.String from a Vector<String> object, or a Class object for java.lang.Integer from a Vector<Integer> object.

I found the Class.getTypeParameters() method, but the best I can get out of that is a java.lang.Object Type object.

This isn't crucial to my project, so if it's impossible it's impossible. It would really simplify maintenance and documentation if there is a way to get it, though.

Any ideas?

Just to double check what you're meaning, given any Vector<?> you want to retrieve the class of ? at runtime? Sorry to say but you can't. Java uses type erasure for generics which means at runtime all the type information is gone.

ColdPie
Jun 9, 2006

F'Nog posted:

Just to double check what you're meaning, given any Vector<?> you want to retrieve the class of ? at runtime? Sorry to say but you can't. Java uses type erasure for generics which means at runtime all the type information is gone.

Lame. Then what's the point of Class.getTypeParameters()?

F'Nog
Jul 21, 2001

ColdPie posted:

Lame. Then what's the point of Class.getTypeParameters()?

It just gives you a nice representation of the classes generic declaration.

i.e.

code:
    class Farts<K extends AbstractList>
    {
        private K what;

        public Farts(K what)
        {
            this.what = what;
        }
    }
If I pull off the type parameters you get a name of 'K' and a bound of AbstractList because I'm contraining the super classes/interfaces. Generic declaration then basically drills down in case you've got a class with generics which then itself is generic.

zootm
Aug 8, 2006

We used to be better friends.
Yeah, using generics at runtime is pretty much a dead end in the current implementation. It's just a compiler restraint (so you can, for example, get access to stuff like that by using an annotation processor, but that's unlikely to be what you want).

Thom Yorke raps
Nov 2, 2004


I just started a co-op (my first job programming), and one thing I see in a lot of the code is the following:
private final int ONE = 1;
private final double FIVE = 5.0;


I always thought that was bad coding; why not just use 5.0 in the code. The only thing I can think of is if you want to be able to modify all references of "FIVE" in one location. However, it probably shouldn't be named "FIVE" if you want to do that, because if you change it to FIVE = 6.0, then the name of the variable isn't really useful anymore.

Is this bad coding practice, or am I just stupid? They also do multiple return statements in methods often, which I thought was another no-no.

csammis
Aug 26, 2003

Mental Institution

Ranma4703 posted:

I just started a co-op (my first job programming), and one thing I see in a lot of the code is the following:
private final int ONE = 1;
private final double FIVE = 5.0;


I always thought that was bad coding; why not just use 5.0 in the code. The only thing I can think of is if you want to be able to modify all references of "FIVE" in one location. However, it probably shouldn't be named "FIVE" if you want to do that, because if you change it to FIVE = 6.0, then the name of the variable isn't really useful anymore.

Is this bad coding practice, or am I just stupid? They also do multiple return statements in methods often, which I thought was another no-no.

It's strange, yes, and you're right to recognize it as odd. That said, they may very well have a good reason in whatever context it exists (though it had better be good for something like that). This happens a lot when you hit the Real World, it's not often black-and-white this-is-good-and-this-is-bad. Ask another developer why it is like it is, but don't sound like a stuck-up academic prick about it :)

oh no computer
May 27, 2003

Ranma4703 posted:

They also do multiple return statements in methods often, which I thought was another no-no.
I've never understood the big hullabaloo about this.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

BELL END posted:

I've never understood the big hullabaloo about this.

Depending on the size of the method, having just one exit point can definitely be helpful.

That said, you shouldn't have monolithic methods that can't fit on a screen if you can help it.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

BELL END posted:

I've never understood the big hullabaloo about this.

Me neither. It's one of those things that just comes down to readability. Multiple return statements are bad when they're bad - ie hard to read - and not when they're not. Just like everything else.

Incoherence
May 22, 2004

POYO AND TEAR

Ranma4703 posted:

I just started a co-op (my first job programming), and one thing I see in a lot of the code is the following:
private final int ONE = 1;
private final double FIVE = 5.0;


I always thought that was bad coding; why not just use 5.0 in the code. The only thing I can think of is if you want to be able to modify all references of "FIVE" in one location. However, it probably shouldn't be named "FIVE" if you want to do that, because if you change it to FIVE = 6.0, then the name of the variable isn't really useful anymore.

Is this bad coding practice, or am I just stupid?
This is an overblown case of "don't have magic numbers in code".
code:
private final int NUM_FOOS_IN_BAR = 5;
is fine because you might want to change the number of foos in a bar. You will never want to change the definition of 5, I hope, and if FIVE refers to something in particular it should be named for what it does rather than FIVE.

The better answer is csammis's: ask them about it. If there's some good reason for it you might want to know what it is.

quote:

They also do multiple return statements in methods often, which I thought was another no-no.
There's nothing intrinsically wrong with that, unless the method has some sort of cleanup associated with it that you don't want to do multiple times. On the scale of "control flow constructs that make code unreadable", multiple return statements are fairly low.

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

BELL END posted:

I've never understood the big hullabaloo about this.
I think it stems from days when functions were bigger and inlining was a Bad Idea because memory was so expensive. So a return in one and only one spot ensured that any post-processing that had to be done - even on an error condition - would be done. I think it's similar to the faux pas of using goto except return only happens within a single scope. These rules were probably made before I was born though, so the guys that made the rules are too senile to even know that I'm breaking those rules now anyway.

Personally, I think a lot of "rules" like that are established in schools so that novice programmers learn to keep code easier to read and it's an unwritten rule that once you have a serious justification for it that all those old "rules" are irrelevant. That's kinda how I view rules in general, but unfortunately I keep getting flack for violating the "don't kill the mailman" rule because apparently I don't have enough experience killing people in general yet to justify killing the mailman.

Withnail
Feb 11, 2004

Ranma4703 posted:

Is this bad coding practice, or am I just stupid? They also do multiple return statements in methods often, which I thought was another no-no.

It seems to be bigger deal in C. I try to keep a single exit point in Java methods, but hardly anyone else does where I work, and it never gets brought up in code reviews.

Contract Otter
May 31, 2007
I've now gone through two courses of Java-programming in my university and while I feel I know the basics of the syntax and object orientated programming, I'm a little frustrated that I don't really know how to program anything usable or sensible. Knowing how to program Game of Life or how to implement interfaces isn't exactly an adrenaline rush.

So do you have any advice where to go from here towards actual programming?

Twitchy
May 27, 2005

Contract Otter posted:

I've now gone through two courses of Java-programming in my university and while I feel I know the basics of the syntax and object orientated programming, I'm a little frustrated that I don't really know how to program anything usable or sensible. Knowing how to program Game of Life or how to implement interfaces isn't exactly an adrenaline rush.

So do you have any advice where to go from here towards actual programming?

There's no "golden path" when it comes to programming. Just practice... alot, start small and work towards bigger projects, find out what works / is effective and read up on things you'd like to be able to do in your apps and apply them. Sort of generic advice, but programming is a pretty big subject that it's impossible to have "do this, then do that".

such a nice boy
Mar 22, 2002

Contract Otter posted:

I've now gone through two courses of Java-programming in my university and while I feel I know the basics of the syntax and object orientated programming,

Don't say orientated.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

such a nice boy posted:

Don't say orientated.

I find it really disorientating when people pronounce it that way.

Contract Otter
May 31, 2007

Twitchy posted:

There's no "golden path" when it comes to programming. Just practice... alot, start small and work towards bigger projects, find out what works / is effective and read up on things you'd like to be able to do in your apps and apply them. Sort of generic advice, but programming is a pretty big subject that it's impossible to have "do this, then do that".

Yeah, I guess I'll just think of something and start coding.

such a nice boy posted:

Don't say orientated.

I'm actually pretty impressed how stupid I made myself seem but I guess I'm just not linguistics orientated enough.

ReaperUnreal
Feb 21, 2007
Trogdor is King
I feel like strangling Java right now, so to keep myself away from the police I will ask here. I'm no stranger to Java, on my 5th year of my 4 year comp-sci program I know it front and back. Somehow though, Sockets seem to be destroying me right now and I have no idea why. It seems that the order in which I create the input/output streams from a socket may or may not break the program. Here's what I mean,

code:
// create the output and input streams
dos = new DeflaterOutputStream(client.getOutputStream(), new Deflater(Deflater.BEST_COMPRESSION));
oos = new ObjectOutputStream(dos);

// send the scene
oos.writeObject(scene);

// send the render size
oos.writeObject(renderSize);

// send the render coordinates
oos.writeObject(workPool.poll());
dos.finish();

// get the render surface
ois = new ObjectInputStream(new InflaterInputStream(client.getInputStream()));
RenderSurface rs = (RenderSurface) (ois.readObject());

// get the render coordinates
RenderCoords rc = (RenderCoords) (ois.readObject());
This works fine.

code:
// create the output and input streams
dos = new DeflaterOutputStream(client.getOutputStream(), new Deflater(Deflater.BEST_COMPRESSION));
oos = new ObjectOutputStream(dos);
ois = new ObjectInputStream(new InflaterInputStream(client.getInputStream()));

// send the scene
oos.writeObject(scene);

// send the render size
oos.writeObject(renderSize);

// send the render coordinates
oos.writeObject(workPool.poll());
dos.finish();

// get the render surface
RenderSurface rs = (RenderSurface) (ois.readObject());

// get the render coordinates
RenderCoords rc = (RenderCoords) (ois.readObject());
This however hangs on the line that creates the ObjectInputStream, and I have no idea why. The java doc is of no help, so I'm hoping that someone here has encountered this before. It's becoming REALLY annoying, and I'm considering switching everything over to CORBA or JavaSpaces despite the work, just because this is being so annoying. Oh btw, this code is inside the run() method of a Runnable object.

zootm
Aug 8, 2006

We used to be better friends.

ReaperUnreal posted:

The java doc is of no help

quote:

Creates an ObjectInputStream that reads from the specified InputStream. A serialization stream header is read from the stream and verified. This constructor will block until the corresponding ObjectOutputStream has written and flushed the header.
ObjectInputStream(java.io.InputStream)

You're causing deadlock by waiting for input before it's been produced in the same thread.

zootm fucked around with this message at 10:13 on Mar 21, 2008

ReaperUnreal
Feb 21, 2007
Trogdor is King

zootm posted:

ObjectInputStream(java.io.InputStream)

You're causing deadlock by waiting for input before it's been produced in the same thread.

Huh, how did I not see that? Thanks for the help, looks like I'll be reorganizing things. This'll be fun, having to create input and output streams inside a loop. Honestly, some times, I wish I was using C instead of Java.

nik9000
Jan 29, 2005
Some general tips:
Learn a functional programming language if you don't know one. You'll never make money from it, but you'll get a good perspective. Try Lisp or Haskelif.
Never write code when there is a good tool out there that will do the job for you.
Java is very thready so you need to learn how threading works. This is especially true if you plan on writing GUIs.
JMX is a good thing. JConsole is your friend. You'll never find deadlocks faster.
Logging is a good thing. You'll never find bugs faster.
Learn the JVM parameters, especially those about memory.
Know that 64bit JVMs need about twice the memory that 32bit JVMs need.
Plan for failures, especially around integration with remote systems. Make sure to fail as gracefully as is appropriate. Deadlock is seldom the right answer. Crashing sometime is.

Here are some tools I have found useful:
Ant is nice build tool. Its like make for java but good. If you don't know it and you plan to make money with java then you need to learn it. You'll never type javac again.

Once you learn Ant, learn Maven. Its better because its more than a build tool, its a project management tool.

Guice is a simple framework for dependency injection. Its like Spring, but very simple. If you are writing a sizable application or a reusable library then I suggest this as glue.

The google collections library has some neat tools. I just found it so I haven't used it yet, but I can see the potential.

Logback is the best logging framework I've used. You need a logging framework so you may as well use the best. Logback is fast and conventient. Any slf4j log framework is good. I'd stay away from Apache commons logging because it can have funky class loader problems.

JCS is a well thought through caching system. Its good if you really need to cache things from a database.

Speaking of databases, I've had a great time using Postgresql. Its quick and second only to Oracle in terms of features. The only real problem is that you have to tune the hell out of it when you get large databases (bigger than your ram).

Saxon is a great Swiss army knife for XML. It does Xquery and XSLT quite quickly and quite correlty. Use it if you absolutely have to do stuff with xml.

Antlr is a fun tool for text/pattern recognision. If you can't do it with regular expressions, you can do it with Antlr. Its documentation is kind of weird, but the mailing list is good. Its also stupid fast. Not yacc fast, but still.

zootm
Aug 8, 2006

We used to be better friends.

ReaperUnreal posted:

Huh, how did I not see that? Thanks for the help, looks like I'll be reorganizing things. This'll be fun, having to create input and output streams inside a loop. Honestly, some times, I wish I was using C instead of Java.
More generally, why are you serialising and deserialising Java objects in one method?

nik9000 posted:

Once you learn Ant, learn Maven. Its better because its more than a build tool, its a project management tool.
Maven's always a point of contention; a lot of people don't like it. I'm not personally a fan myself, I find its behaviour a little too opaque and wide-ranging. It's respected by a lot of other people too, though, it's just a bit of a "love it or hate it" thing.

zootm fucked around with this message at 18:57 on Mar 21, 2008

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

zootm posted:

Maven's always a point of contention; a lot of people don't like it. I'm not personally a fan myself, I find its behaviour a little too opaque and wide-ranging. It's respected by a lot of other people too, though, it's just a bit of a "love it or hate it" thing.

I'm in the Ant + Ivy camp myself. Maven is really a bitch to get going.

Spartan22x
Dec 22, 2006

by Fragmaster
Okay, I have an Eclipse problem. I'm trying to do a school project with it, but I can't figure out how to get it to do what I need it to. I have a large set of precomplied class files which don't have any source files with them (well, only 2 have their source code, the rest are just .class files). I'm trying to do a project in which I have to extend the one class that I have the source for. However, when I try to use that directory with Eclipse, it deletes all of the .class files. Is there any way I can make a project with a preexisting library of .class files in eclipse?

nnnotime
Sep 30, 2001

Hesitate, and you will be lost.
I'm looking for guidance on recommended online Java studying resources. I'm in-between a junior and senior-level type of corporate programming position, and having to switch focus from the .NET framework to Java due to being placed in a new development group that is completely Java oriented.

I'm concerned about building up my Java knowledge so I can hold my own in the new position, as opposed to interviewing for a new job. I'm already using Eclipse at work and have access to a lot of Java source code to help me hit the ground running.

I know some aspects of the Java language and have worked on modifying existing code in a few Java-based projects, but now I need to bulk up on the fundamentals, design patterns, various frameworks and APIs (JMS, Spring, threading, etc.).

For plain Java, Eckel's Thinking in Java was recommended earlier in this thread, and I noticed his 3rd edition, published in 2002, is available for free but his 4th edition is not free. Here's a link to the third edition, which has link to 4th edition page:
http://www.mindview.net/Books/TIJ/

Are there any significant differences between Eckel's 3rd and 4th editions that I should consider purchasing the 4th edition instead? I don't mind spending money if I will be able to obtain the latest-and-greatest information.

How useful are Sun's Java Learning Center pages?
http://java.sun.com/learning/index.html

How effective is the Java Blackbelt site for testing your own knowledge for various Java-based frameworks and APIs?
http://www.javablackbelt.com/

On first glance I'm not crazy about javablackbelt.com's contribution-point system, since I do not like have my learning held back by a system that requires me to spend time attempting to add value to website content based on a subjective criteria. I also don't like their mandatory waiting period to retake tests, unless I can skip the belt-obtainment altogether.

nnnotime
Sep 30, 2001

Hesitate, and you will be lost.

Spartan22x posted:

Okay, I have an Eclipse problem. I'm trying to do a school project with it, but I can't figure out how to get it to do what I need it to. I have a large set of precomplied class files which don't have any source files with them (well, only 2 have their source code, the rest are just .class files). I'm trying to do a project in which I have to extend the one class that I have the source for. However, when I try to use that directory with Eclipse, it deletes all of the .class files. Is there any way I can make a project with a preexisting library of .class files in eclipse?

Hmm, perhaps you need to treat the existing class files with no source code as external libraries for the project, which is no different than referencing a separate jar file.

Put your class files in a separate directory from the source folder, then open up your Java project's properties and add the classes as a library (under the libraries tab of the Java Build Path setting). Just leave out the classes from the class folder that you have the source-code for, since Eclipse will build new classes for those .java files.

1337JiveTurkey
Feb 17, 2005

nnnotime posted:

For plain Java, Eckel's Thinking in Java was recommended earlier in this thread, and I noticed his 3rd edition, published in 2002, is available for free but his 4th edition is not free. Here's a link to the third edition, which has link to 4th edition page:
http://www.mindview.net/Books/TIJ/

Are there any significant differences between Eckel's 3rd and 4th editions that I should consider purchasing the 4th edition instead? I don't mind spending money if I will be able to obtain the latest-and-greatest information.

In 2002, it'd be talking about Java 1.3 or 1.4 (both are pretty drat old). I wouldn't look at anything which talks about Java before 1.5 except for purposes of maintaining legacy code. Even with legacy code 1.4.2 is as old as I'd venture and I'm hoping to avoid having much to do with my company's clients still stuck on 1.3.1. It's still important to know when certain things came into being or became usable (Ask me about JAXB 1.0), but new code should be predominantly written with the newer versions of the language.

quote:

How useful are Sun's Java Learning Center pages?
http://java.sun.com/learning/index.html

The Sun documentation can be pretty good, although I'm not a fan of their XML/Web Services tutorials and security is just a nightmare regardless. Learning the (very) extensive APIs should probably be one of your first goals. Start out with something simple and sane like java.util.logging and slowly expand your horizons outwards.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

1337JiveTurkey posted:

In 2002, it'd be talking about Java 1.3 or 1.4 (both are pretty drat old). I wouldn't look at anything which talks about Java before 1.5 except for purposes of maintaining legacy code. Even with legacy code 1.4.2 is as old as I'd venture and I'm hoping to avoid having much to do with my company's clients still stuck on 1.3.1. It's still important to know when certain things came into being or became usable (Ask me about JAXB 1.0), but new code should be predominantly written with the newer versions of the language.


The Sun documentation can be pretty good, although I'm not a fan of their XML/Web Services tutorials and security is just a nightmare regardless. Learning the (very) extensive APIs should probably be one of your first goals. Start out with something simple and sane like java.util.logging and slowly expand your horizons outwards.

I'm curious what that client's excuse for sticking with Java 1.3 is. Did they use some Sun internal API that got removed?

Adbot
ADBOT LOVES YOU

F'Nog
Jul 21, 2001

TRex EaterofCars posted:

I'm curious what that client's excuse for sticking with Java 1.3 is. Did they use some Sun internal API that got removed?
I've worked with a bank's gateway package that threw a runtime exception if it detected a 1.5 VM. People do the wackiest things, I can't really think of anything that's actually been removed rather than deprecated.

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