J
jk
Hi:
My understanding of classes is that a class serves as a wrapper for
a data, and the operations that can be performed on the given data.
This is not a very specific definition, but is the motivation for
my question. The instances of classes are called by their handle.
For instance: adding a string to a vector
Vector v = new Vector();
v.add("ABC");
Strings are different in that they can be called by
a handle, or they can be called by a literal String.
eg:
String s = "ABC";
int len1 = s.length();
int len2 = "ABC".length()
So, this seems 'inside out' ...
The data that should be wrapped by the class
is used to invoke methods upon itself from
outside the class.
Can someone explain how this is done...
Thanks in Advance
John
My understanding of classes is that a class serves as a wrapper for
a data, and the operations that can be performed on the given data.
This is not a very specific definition, but is the motivation for
my question. The instances of classes are called by their handle.
For instance: adding a string to a vector
Vector v = new Vector();
v.add("ABC");
Strings are different in that they can be called by
a handle, or they can be called by a literal String.
eg:
String s = "ABC";
int len1 = s.length();
int len2 = "ABC".length()
So, this seems 'inside out' ...
The data that should be wrapped by the class
is used to invoke methods upon itself from
outside the class.
Can someone explain how this is done...
Thanks in Advance
John