Lesson 1.2b - Abstract Data Types As we learn Java, we will work with many abstract data types. Some of these will be pre-defined and some we will create ourselves. For now, we will work with the abstract data type String. The String data type is capable of holding one or more characters and can be used to store words or even whole sentences. For example, suppose a program we are writing requires that we store the name of a person. A String variable will be the choice for this job. Recall that a char variable is only capable of storing a single character and cannot store an entire word. Lastly, since a String is an abstract data type, it is actually a pre-defined class. That means that we can make method calls that perform actions with Strings like we did with robots. More on this later...
|
|||||||||||
© DanShuster.com