Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Tom Henner

Greenhorn
+ Follow
since Jul 04, 2005
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 Tom Henner

I'm a newbie in the middle of the second section of the cattle drive. The $200 is for code review by people who have seen the problems and various solutions to them, and are willing to take the time to give hints and corrections. It has been a very good investment for me.
12 years ago
Carol,
It sure works that way for me. The nitpicking helps a lot. I've always just focused on input/output and making sure users can't break anything. Now I'm learning to check to see if that extra cast is necessary, if something can be cleaner, etc.

Tom
12 years ago
Carol,
Keep after it! I really appreciate your posting versus going through the private message route. I will benefit greatly after I can get through the OOP section and into servlets. BTW, I don't understand why more people aren't active cattle drivers. It is the best $200 I've ever spent (for anything technical) :-) .

Tom
12 years ago
**UPDATED- FIXED** I had not accepted changes in both steps.
""After making your changes, click on the OK button on both the Environment Variables dialog and the System dialog. You will not need to restart your computer, but you will need to restart any applications which may have read the CLASSPATH settings before your changes (including any Command Prompt windows).""

I'm running Windows 2000 and went to Start>>Settings>>Control Panel>>System>>Advanced>>Environmental Variables and highlighted CLASSPATH from the System Variables window and selected edit. CLASSPATH now looks like this:

C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\Microsoft SDK for Java 4.0\Bin;c:WINNT\JAVA\Classes\Classes.zip;C:\Program Files\Microsoft ActiveSync;c:\tom\source;c:\java5\javaranch; c:\java5\javaranch\jr.jar;

Tom

[ September 14, 2005: Message edited by: Tom Henner ]
[ September 14, 2005: Message edited by: Tom Henner ]
12 years ago
My CattleDrive classes and java files are in c:\java5\javaranch folder.
To support the DaysOld assignment, I copied jr.jar into that folder.
I changed my classpath, adding c:\java5\javaranch\jr.jar; to my last entry, which was c:\java5\javaranch;. Then I rebooted.
I need to reference GDate and JDate that are in jr.jar, and I am trying to get to them through import com.javaranch.common.* ; as my first statement in DaysOld. When I compile at c:\java5\javaranch the compiler complains that com.javaranch.common does not exist. What step am I missing?
12 years ago
What happens when you run this? What is your question?
12 years ago
I bought a used Just Java 2 book for the Cattle Drive from Amazon, and it was in perfect shape. That was my first purchase of a used book.
12 years ago
Yes- any class that inherits the abstract class will need that class to be constructed for it to inherit its members. And the abstract class may have implemented methods that its chidren may need.
12 years ago
Java passes a copy of the reference value. So setting a to null does not change the reference that b already has. Your object is safe from the gc.
12 years ago
Strings are immutable. If you change one it really is creating a new one behind the scenes.

String a = "123456789" ;
int l = a.length();
int l2 = a.toCharArray().length ;
System.out.println( "" + l + " " + l2 ) ; //9 9
a = "12345678" ;
l = a.length();
l2 = a.toCharArray().length ;
a = "12345678" ;
System.out.println( "" + l + " " + l2) ; //8 8
12 years ago
Paul- I don't have access to Time to test- but could it be the locale is the problem? If you pass in the start and end values they do seem 11 seconds apart. Maybe try passing those into Time and printing.
12 years ago
Carol,
I thought I was looking forward to breezing past OOP and into servlets (not that I've even gotten past SayB yet), but sounds like the winds are strong and the creeks are high! Good luck getting everything running. I hope I'll be able to benefit from your experiences very soon.

Tom
12 years ago
Ask to talk with a power user. I think it is most important to get an idea of the functionality from the user standpoint first. And even if the system docs are weak, often there is user documentation that will give you a good overall view of what the app does. In larger orgs there may even be a bug/enhancement list that tells what users want or are frustrated with.
12 years ago
Although I don't use AOL, I had a similar problem last month that was fixed by switching from html to text in my outlook sending preferences. It was on a Friday, and I thought my nitpicker was pulling my leg at first as it looked fine on my end.
12 years ago
You could put a debugging aide like
System.out.println( Integer.toString( factorial( n - 1 );
at the point you want to see the value. Since this is a method, I believe the values would be stored in the stack, with each recursion calling the next one till n == 1.
12 years ago