Java Paint: Part 1

Java includes a load of libraries for creating applications with graphical user interfaces (GUI). One of the first things that a programming student is introduced to when learning about Java GUI development is drawing shapes onto a “canvas”. In this post I am going to talk about Java Swing objects that can help achieve this and begin to flesh out a little program that demonstrates some of the ideas that are covered.

[Read more →]

 

Java private class fields not so private

Brushing up on some Java I came across an interesting “feature” of private class fields that reference mutable objects.

I thought it might help someone if I show how to get round the issue.

[Read more →]

 

Java string reverse methods analyses

Following on from my previous post about making a simple palindrome detector, I analyse the performance of five different methods for reversing a string in Java.

[Read more →]

 

Posted

24 January 2008 @ 3pm

Posted in: JavaRuby

1 Comment

Palindrome: Java & Ruby

One thing that programming students often have to implement is a program to tell whether or not a string is a palindrome. In this post I flex my dusty Java and demonstrate a simple palindrome detector.

[Read more →]