Friday, March 4, 2011

Purse is done!

Today I finally finished the Purse code. I had a little trouble with it in the beggining because I was confused at if the string was an object or a class.
We also took a note informing us about datatypes and other things which made Java a lot clearer.

1 comment:

  1. In Turing, string is a primitive (read: basic) datatype. In Java, String is a class, and so every String is an object of that class.

    This is a significant difference! Amongst other things, it means that methods can be called against Strings. For example, you can ask a String its length:

    String studentName = "Fahim";
    System.out.println("Your name is " + studentName.length() + " characters long");

    ReplyDelete