Kevin Mckeon

+ Follow
since Jan 17, 2018
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 Kevin Mckeon

After many frustrations and plenty of eureka moments. I have implemented my own Linked-List class

Please have a look at let me know where it falls short.

(I already know I need to add in try/catch blocks for out-of-bounds errors that arise, but is that the best solution ? )  

1 week ago
People say that ArrayLists are preferable to arrays because Arrays are immutable.

If you want to add an element to an array, you have to pretty much overwrite it with a new array which is one size larger containing the new entry.

Hence ArrayLists come in handy as they have the Add function which is more efficient as you don't have to use memory overwriting the ArrayList with a new ArrayList

However, looking into the makeup of ArrayList, it appears that the fundamental structure behind an ArrayList is in fact an array so in order to edit the ArrayList, you are editing an Array (on a deeper level)

Does this mean that an ArrayList is actually more inefficient than an array ?

Does the same logic apply to String and StringBuilder ?
4 weeks ago
I'm interested to hear from developers who have worked in long term or contract positions outside of Ireland be it Asia, America or Europe.

Id like to travel abroad while working but its fairly difficult to find information online about the software development market in countries and cities in terms of working hours, pay, flexibility, experience required, competition with locals etc. It's even more difficult if the country doesn't speak English as a first language.

I'm particularly interested in large Asian cities like Tokyo, Hong Kong, Singapore, Shanghai, but any interesting stories or job hunting advice in any city would be helpful.

I'm not worried about working visas or relocation issues just yet as I wont be moving anywhere any time soon but its better to start the research early in order to make plans and start building up the portfolio.
1 month ago

Getting the error : 

Multiple markers at this line
- The type TreeSet is not generic; it cannot be parameterized with arguments
- The type TreeSet is not generic; it cannot be parameterized with arguments

Ive tried as many combos of " TreeSet<String> set1 = new TreeSet<>(); " as i can and no luck !
1 month ago
i forgot to add the second attachment !
2 months ago
Im working off a tutorial to create an app using Spring MVC

I have a couple of questions about my project

1.  From the project structure attached, how come I have two pom.xml files ? Both have the same content, (spring dependencies) and also why is it buried in the Workspace folder - doesn't look normal
Why do my packages look and act like folders? Is this simply an superficial thing or will this cause problems ? (i also noted my java classes doent flag errors if I make a typo)

2.  I get a 404 not found error when running my app on tomcat (But i am able to view the Index 'Hello world page)

I believe this means the project is created properly but I have a typo somewhere in my directory which leads to the 404. - I just want to make sure that this is the case before ruling out error with my workspage setup
2 months ago
How many times will the following code print "Hello World"?

A. 9
B. 10
C. 11
D. The code will not compile because of line 3.
E. The code will not compile because of line 5.
F. The code contains an infinite loop and does not terminate.

this is my interpretation :

First iteration
i is equal to 0,
i is reassigned as itself (still 0)
i is incremented by 1 (i is now 1)
Print Statement

Second iteration
i is equal to 1,
i is reassigned as itself (still 1)
i is incremented by 1 (i is now 2)
Print Statement

10th iteration
i is equal to 9,
i is reassigned as itself (still 9)
i is incremented by 1 (i is now 10)
Print Statement
: end of loop

However the correct answer is F which I cant really understand

F. In this example, the update statement of the for loop is missing, which is fine as the
statement is optional, so option D is incorrect. The expression inside the loop increments
i but then assigns i the old value.
Therefore, i ends the loop with the same value
that it starts with: 0. The loop will repeat infinitely, outputting the same statement over
and over again because i remains 0 after every iteration of the loop.

7 months ago

Dave Tolls wrote:Well, the first thing I can think of is testing.
Unit tests, especially if defined beforehand (Test Driven), would help you know if your code fulfills requirements.
I can think of some edge cases that might cause issues with your code, eg what happens if the user doesn't enter a valid accountNumber?

Thanks for the advice, Ive never really done testing apart from trying out a few inputs and checking i get the right answer.

Is there a particular method, plugin, or system to fully test this kind of a program ?

Or is it always a manual process of thinking up a set of test cases and keying them in one by one
7 months ago
Hi Guys,

Im good at java but when self learning its hard to know if the classes and methods you create are designed properly.

I've created an ATM application that contains 3 classes, and

The App creates an ATM class (which in turn creates multiple Account classes) and requires user input to choose an account number then choose to view, withdraw or deposit funds

From the point of view of Abstraction, security, and best practice etc, can anyone advise what I should look to impliment, any relevant articles or courses on class design or general pointers

7 months ago

I have an ATM class, that simulates an ATM. When this class is created in my App, it populates an arrayList with a set of account objects

Im trying to access an account object within this arrayList and return the balance of that account

Here is my ATM class

and here is my account class

Im able to access the slot in the array that has an Account, but how do I access the methods of that particular account object
7 months ago

Kevin Mckeon wrote:

Knute Snortum wrote:Does the class you're running have a main() method?

Is a valid class -

and this class uses the Stopwatch class which has a constructor and a couple of methods.

I think the problem has to do with my run configuration.

I forgot the [] from the main method. Its not as valid as i though. case closed
7 months ago

Knute Snortum wrote:Does the class you're running have a main() method?

Is a valid class -

and this class uses the Stopwatch class which has a constructor and a couple of methods.

I think the problem has to do with my run configuration.
7 months ago
I did a project last week using struts and tomcat, which all worked fine

This week, I made a new project in my workspace with a few simple classes as I am practicing a few basic Java concepts

Every time I try to run my simple class, I get the message "The selection did not contain any resource that can run on a server" (although I'm not even fully sure which class its trying to run!)

I've tried changing perspective from JaveEE to Java, and I've tried to "Run As.." but this only brings up " run on mobile browser Simulator
7 months ago

Campbell Ritchie wrote:€1200 is no slight sum if the course isn't any good. Have you phoned to ask for more details? How does that material match your current skill set? Can you get more practice by other methods, e.g. creating projects, or frequent posting on this sort of forum?

Im beginning to feel now that neither course would be worth doing.. There is a huge difference between the courses I'm talking about and the beginner / intermediate / advance course I have found online :

Beginner -
Intermediate -
Advanced -

(This course is somewhere in the USA, but I'm just using it as a comparison)

Also a 3 hour lecture for 11 weeks isn't a lot of class time (bearing in mind not all material will be new). I would say I've touched on about one third of the material from each of the evening courese

Maybe my €1200 would be better spent on a solid book, a laptop upgrade, a few concentrated Udemy courses and self study plan/project that I implement over 12 weeks or so.
7 months ago