Win a copy of Terraform in Action this week in the Cloud forum!

Mike Rolf

Greenhorn
+ Follow
since Mar 04, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Rolf

I just went for the trial & error approach and kept increasing the size of the memory until it worked. I now have it set to 512Mb and my application seems to work fine.

Thanks for your help Joe.
13 years ago
Thanks Joe, one more question how would I go about working out how much memory my app needs? At the moment all I'm seeing is an OutOfMemoryError.

Mike
13 years ago
My application, which deals with large data sets, is throwing a java.lang.OutOfMemoryError error.

From what I've read on the web it looks like I need to increase of the memory of the JVM. I've read I can use the -Xmx command.

Can someone confirm if this is the command I should use, and what a 'reasonable' size to increase it to is?

i.e. -Xmx256m, is that reasonable?

Thanks,

Mike
13 years ago
Hey,

Simple Tomcat question hopefully, how does it know where to look for web applications, is it set in some xml file?

For example;

I have tomcat installed in ../servers/tomcat
I use netbeans to create a web app, which creates it in ../NetBeansProjects/WebApplication1

How does tomcat know to look in ../NetBeansProjects/WebApplication1 ?

Cheers,

Mike
13 years ago
Can someone give me a good example of when you would want to use the join() method of the Thread class?

I'm well aware of what the method does, I just cant think of a good example of when I'd use it.

Cheers,

Mike
When thinking about member access modifiers, its good to think in terms of the code as you see it, rather than in terms of objects/instances. By that I mean;

Members marked private can only be accessed by code in the class in which the private member was declared.

Question 1) It follows therefore that 'private String name' which was declared in class PrivateModiferTest can be accessed by code in that class.

Question 2) When you move the code trying to access the private member to another class, then the same rule applies, so the code doesn't compile.

Hope this helps,

Mike
Determining a match in a hashset is a two step process,

1) Calculate hashcode, to find out which 'bucket' the item should be in
2) Compare each items in that bucket to see if they are equal to the item you want to add

The hashcode() method is not overriden in the question, therefore Object hashcode() method will be used, which will return a unique hashcode for every object. Each object added will be added to its own bucket, therefore the equals() method will not return a match.
Hi,

Having searched through a long list of mocks and example questions, I found many weren't very good, contained wrong answers or were just too old. So I thought I'd share with you a short list of the ones I think are worth doing;

1) John Meyer's Exam
http://enigma.vm.bytemark.co.uk/webstart.html

2) MasterExams CD Mocks that come with the SCJP book by KS & BB

3) The questions in the SCJP book by KS & BB

4) The questions available on the sun website.


Cheers,

Mike
I still think that the above question/answer is wrong however, because javac requires you specify the PATH of the source file (the file to be compiled).

For example;

Directory structure: project/foo/bar/MyClass.java
Current directory: project

To compile MyClass.java the command would be: javac foo/bar/MyClass.java

Regardless of what the classpath was set to.

Agree?

Cheers,

Mike
I wasn't aware of that the classpath did look for .java files, if sourcepath wasn't specified. Thanks for clearning that up.

Mike
Although -classpath can be used with both java and javac, it serves the same purpose. The classpath tells the JVM where to look for the .class files, not where to find the .java files.

I still think the above answer/question is wrong. Other views appreciated.

Cheers,

Mike
I've just started to do a few of the questions in the MasterExam simulation and some of them seem to have wrong answers. Example question below;

********************************************************************************
Question:

If three versions of MyClass.java exist on a file system:
Version 1 is in /foo/bar
Version 2 is in /foo/bar/baz
Version 3 is in /foo/bar/baz/bing

And the systems classpath includes the following:
/foo/bar/baz

Which command line(s) will use Version 2 of Myclass.java? (Choose all that apply.)
A) javac -cp /foo/bar:/foo/bar:. MyClass.java
B) javac -cp /foo/bar/baz:/foo/bar MyClass.java
C) javac -cp /foo/bar/baz/bing:/foo/bar:. MyClass.java
D) javac -cp /foo/bar/baz/bing:/foo/bar/baz MyClass.java
E) The result is not predictable.

Answer B.
******************************************************************************

I have two questions;

1) Surely the above answer is wrong because the classpath doesn't effect where javac looks for the .java file
2) Have people found other questions with wrong answers, can I expect a few more?

Cheers.