ITI 1121 Lecture Notes - Lecture 5: Arity, Primitive Data Type, Object-Oriented Programming

114 views3 pages

Document Summary

A variable is a plave in memory, to hold a value which we refer to with the help of a label. Comparison operators primitive & reference data types. When it comes to primitive data types, they can be compared directly. Meaning that you can use operations like ==, ,etc. on them and no error will arise. This would make to sense to the compiler because b is an instance of an object. An integer cannot be compared to an object. If you are so fixated on fixing the problem, then the following implementation of the code should work. This class takes in a value of type int and assigns value whatever the instance takes in. Data types are there because they allow the compiler to know how much memory to allocate for each variable. It also gives information about the operations that are allowed on it. There are primitive data types and reference data types.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents