Arthur Blair

Ranch Hand
+ Follow
since Sep 20, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arthur Blair

Passed on Sunday!

I did the Marcus Green Tests before and got 72, 76 and 84. I think the actual exam takes longer than the mocks, but that is probably because I was double checking everything.

  • Revise Threads thoroughly. Know your object locks.
  • Check the questions after, then check again for silly mistakes
  • Know the Math class method signatures, and the Wrapper classes well. I know I dropped some marks that could have been saved by some simple memory dumps.

  • The K+B book is by far the easiest read.

    Good luck...
    17 years ago

    I am trying to package up a java desktop appilcation that I have written, but I have not idea where to start! Could someone point me in the right direction.

    I can run my application via NetBeans, but what I want is for it to run by clicking on a icon on the desktop.

    Thoughts appreciated!
    17 years ago
    Is it better OO design to catch an exception at the the user interface level of code, or in a lower level class?

    E.g. I read data from a user, then send it to a lower level class which validates it. I can either throw an exception back up the call stack or handle it in the code. But I want to know whether one solution is condidered better than the other in terms of object orientated design.

    Thoughts appreciated.
    17 years ago
    I'm running Netbeans 4.1 with java 1.5.0_03.
    Sorry. Ignore that. Marcus was right.

    Looking at the following question:

    Question 2)

    What will happen when you attempt to compile and run this code?

    public class MyMain{
    public static void main(String argv){
    System.out.println("Hello cruel world");

    1) The compiler will complain that main is a reserved word and cannot be used for a class
    2) The code will compile and when run will print out "Hello cruel world"
    3) The code will compile but will complain at run time that no constructor is defined
    4) The code will compile but will complain at run time that main is not correctly defined

    ...marcus says the correct answer is 4. But when I run it, the code compiles runs and nothing is printed out.

    Why doesn't it work as the exam answer says?

    Why doesn't dynamic binding work with static methods?

    For example:

    If I have a class

    Then say:

    Liminal l = new SubLiminal();

    The method doesn't go and call the subclass version as you would expect with dynamic binding.

    Is this because calling static methods on a reference is just a syntax trick, and is much the same as saying Liminal.method(); ?
    Thanks mark, but I can only find posts written in 2003 when I search Javaranch for "offshoring" or "off shoring". Do you think you could you provide a link to a more up to date discussion?
    18 years ago
    Speaking as an IT professional from the UK, I'd be interested to hear your thoughts about offshoring. There is plenty of media coverage, but what do you think the actual threats are.

    Are all the java jobs in the UK heading for India and China?

    Should I believe a recent conversation with a London recruitment consultant who said that the market for Java professionals is booming or be a little more weary in my approach?

    Is it worth studying for all the Sun certifications, or would efforts be better applied to becoming a systems analyst?

    Recommendations of some good articles to read are welcome.
    18 years ago
    I'm stuck with the following exam question:

    which of the following lines of code could be inserted, and still allow the code to compile?

    It also says that b2[1][2][0] = b; is incorrect

    According to what I understand, b2 is represented like this:

    So b2[1][2][0] should hold a reference to an array of length = 2, but because b[][] references an array with an extra dimension, it cannot work. (Is that correct?)


    The answers given to be correct are:
    b2[0][1] = b;

    How can this be correct? I would have though that b2[0][1] would have been expecting a reference to a 2D array like the following

    Or does it not matter what the length of the array is, only that is should be two dimensional?

    Thoughts appreciated.
    [ March 15, 2006: Message edited by: Arthur Blair ]
    So... reading the K+B book.

    If you assign an array to a previously declared array reference, the array you're assigning must be the same dimension as the reference you're assigning it to.

    so why does this compile corectly?

    What am I doing wrong here?
    Thoughts appreciated.
    I agree with Tamara. 84% is very good score. You should be proud of that, Subathra! Less of the only]!

    18 years ago
    Yes, it has clicked now! Thank you for your explanation, Rahul.
    I am having some difficulty with the following question from Dan Chisholm:

    The result of running this code is that A1B0A0B1A0B2 is printed out. But I would have expected the output to show A1B0A1B1A1B2. I do not understand how you can go from printing out A1B0 to A0. At one moment the number of A's that have been instantiated is 2, then according to the output, all of a sudden it appears as though no A's have been instantiated.

    Could some one explain why these A's are 0, not 1. A1B0A0B1A0B2

    For example:
    A a1 = new A();
    // after this line, there is one instance of A and the counter shows 1.

    // here there are two, because another is instantiated within the method m2(), so the A() constructor is called and the counter is incremented again to become 2.

    // here no A constructors are called, so I would assume that the counter remains at 2. It never gets reset explicitly, but within this method it appears as though the counter for A is back to 0.


    Could someone explain what is going on here, please?
    Thoughts appreciated.
    [ March 06, 2006: Message edited by: Arthur Blair ]

    Thats not correct. A top-level interface is implicitly abstract, but can be default or public. If it is public it needs to be in a file with the same name as the interface plus the extension .java

    However, If an interface is nested in another class, it's access modifier can be private, default, protected or public. While if an interface is nested within another interface, it can be public or default.

    ...which brings me to my next question. Why on earth would you would to have an interface nested within another interface?