java help

Status
Not open for further replies.

BFG

SatelliteGuys Master
Original poster
Supporting Founder
Mar 2, 2004
8,208
0
Orlando
hey folks need some help from programmers

I have an assignment to write my own string class with various methods
I understand that basically a string is an array of characters and i can store the string into an array by reading each character of the string and storing it in the array.

Problems I have:
I'm getting arrayoutofbounds errors for methods like concat and substring, when i'm pretty sure the approach I'm using, which make a new array of size equal to the 2 strings to be concated

and I'm not sure what lexicographically means, I think it's a fancy way of saying the way in which we determine is 2 terms are equal
 
I know in C++ and in many hybrid languages that are OOP based all string based comparisons have to be made by predefined class comparisons.

If you are programing a linear for loop I believe it will have difficulty working but not impossible. Just make sure you predefine the units to compare by getting the length of the string values then using that number for the loop itself-

But again I believe there are already predefined comparisons already in there you should utilize. I think you are trying to hard to do this from scratch.

I haven't touched programing in a few years and didn't do much with Java but that is all that rings a bell.

Edit forget the above I was answering something you didn't ask.

(Read in a loop till you get to a 'null' character)
get.in till null is met.
 
Status
Not open for further replies.

2 years today and counting down + poll

anybody own a 2004-06 Pontiac GTO

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

Who Read This Thread (Total Members: 1)