Cougar Vis

Greenhorn
+ Follow
since May 12, 2004
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 Cougar Vis

coded this but for somereason it wont let me add a string into it, or do i need a different type of array?


[ November 28, 2004: Message edited by: Cougar Vis ]
17 years ago
Me using the ArrayList library from Java for O.O programming, but i am not quite sure one 3 little things

1.Can i assign the data into a specific slot E.g "banana" a string into slot 3?

2.How do i add a data, do i use "add.xXxX"? or use "set", in O.O prgramming environment?

3.How do i recall the data from a specific slot? Using the example in #1.

Waiting for reply & Thanx in advance

Respect
17 years ago

Originally posted by Marilyn de Queiroz:
CougarV12,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!



hmmm...what's wrong with my name, been using it since then ?
Cougar actually is my nick name, V12 = Vis


=======================================================================

I have no idea how to do and not sure whether you can use array in inheritance.

What i wanted to do is
Eg. 5 Radio cars each one of them can only have 2 action either "F" "B" "L" & "R".
I needed to use inheritance to save on the coding which it possiblely could, but not sure how to use array with it, so it store their action in the superclass, then execute the method in their subclasses
[ November 23, 2004: Message edited by: Cougar Vissert ]
17 years ago
can i use inheritance with array, where the array is stored in the Superclass (first level), then subclass for the methods?

Where can i find some examples for this?
17 years ago
nice link , THANX
18 years ago
Has anyone got any links to OO programming for begineer which is easily understandable and with some online exercies to try out ?

thanx
18 years ago
My array

what is the sytax to get all the value out from those varible in this array? i.e. cIDIn, cFirstNameIn, cLastNameIn, cGenderIn,cAddressIn ,coNameIn, coAddressIn.

THANX

[ edited to break long lines and remove odd formatting -ds ]
[ May 17, 2004: Message edited by: Dirk Schreckmann ]
18 years ago
My contructor like this:

public Customer(String cFirstNameIn, String cNameIn, String cAddressIn,
String cNameIn, String coAddressIn, int cIDIn, char cGenderIn)


{
customerFirstName = cFirstNameIn;
customerLastName = cLastNameIn;
customerAddress = cAddressIn;
companyName = cNameIn;
companyAddress = coAddressIn;
customerID = cIDIn;
customerGender = cGenderIn;
}



and my arrays like this:


public static void main (String [] args)

Customer [] cArray = new Customer[1];

cArray [0] = new Customer (cFirstNameIn, cLastNameIn, cAddressIn,cNameIn, coAddressIn);



what's wrong with this, o...btw this array is used in OO programming

[ May 14, 2004: Message edited by: GK Leo ]
[ May 14, 2004: Message edited by: GK Leo ]
18 years ago
I followed this step:

cArray[0] = new Customer(blah, blah, blah...)



and when i caomplie it again, it said:

A:\Coursework\Customer.java:190: cannot resolve symbol
symbol : constructor Customer (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
location: class Customer
cArray [0] = new Customer (cFirstName, cLastName, cAddress,
^


[ May 14, 2004: Message edited by: GK Leo ]
18 years ago


these are the error I keep getting


[ May 14, 2004: Message edited by: GK Leo ]

[ May 14, 2004: Message edited by: GK Leo ]

[ May 14, 2004: Message edited by: GK Leo ]
[ May 14, 2004: Message edited by: GK Leo ]
18 years ago
i mean other calss access the array value on this sample
18 years ago
sory
but how do i get the value or data from the sample code?

THANX
18 years ago
can i stick a varible inside the [] instead of a value???
18 years ago
How do i get the info out from this code??



THANX

[EJFH: Edited code format ]
[ May 13, 2004: Message edited by: Ernest Friedman-Hill ]
18 years ago
I wanted to create a 2d array and store info into it, but don't know how to do it does anyone have some links or code to show me how to do a 2D array?
18 years ago