Thread: what is difference between int and intlist?

1. Member
Join Date
Oct 2009
Posts
14
Rep Power
0

what is difference between int and intlist?

private final IntList coefficients;

my prof gave me this code in assignment and I'm having trouble understanding what that line does..

is that an array for coefficients? or just fancy way of writing an int?

2. Java Code:
`private final IntList coefficients;`
Originally Posted by kira137
my prof gave me this code in assignment and I'm having trouble understanding what that line does..

is that an array for coefficients? or just fancy way of writing an int?

Neither, IntList is a class. Now, based on it's name, IntList could be a wrapper for List<Integer>, but that's not a guarantee, just a best guess on my part. Instead, you should check if your professor included an IntList class in the notes, or ask if you cannot find such a class.

3. Member
Join Date
Oct 2009
Posts
14
Rep Power
0
ah.. yes there is class called IntList. I thought intList was just a weird way of saying int.
But I have another question, what does the name coefficent do?
because there isn't a method called coefficient inside intList..

is it just naming intList to a different name..?

4. Originally Posted by kira137
ah.. yes there is class called IntList. I thought intList was just a weird way of saying int.
But I have another question, what does the name coefficent do?
because there isn't a method called coefficient inside intList..

is it just naming intList to a different name..?
First, to clarify, Java class names, variables, method names, etc. are case-sensitive. So, IntList and intList are not the same.

Second, coefficients is an instance of an IntList. You could give it any name you choose. The name, usually, is something meaningful, so that it explains it's functionality. For example, the name coefficients could mean it stores the coefficients for a polynomial equation.

From the appearance, coefficients is a private field in a class.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•