Objects and Classes - Types - Primitive Types

4 important questions on Objects and Classes - Types - Primitive Types

Give two examples of data types that has been used in the book.

We have used the data types of:
  • Integer
  • String.

Why are classes also Types?

Classes are also types because our class of Book (or Video) defines a set of possible books or videos.

Each instance of Book must be compatible with attributes defined and would have slots for values for these attributes.

Give four examples of primitive datatypes.

  • Integer
  • String
  • Boolean
  • Real
  • (Date)
  • (Time)
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

What is an advantage of modeling with uml?

It might be best to do your modeling with the built- in types and have the tool do the translation at code-generation time, as this is the most portable approach.

One of the advantages of modeling with UML is that you can target different implementation languages without changing the model

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo