# What is the difference between class and set?

• chingkui
In summary, a class is a collection of objects, while a set is a model of a class. Classes can have properties, while sets cannot. Sets are extensions of properties, while classes are not. The empty class is usually a set.
chingkui
What is the difference between class and set? I have seen statements like "Let M be a class of subsets of X...", and it seems to me we can still do everything we like as though M is a set, and we are just avoiding the word "set" and replace it with "class". I am aware of the paradox "the set of all sets..." lead to, my question is what exactly is the difference between class and set? What sort of operations is prohibited in class while we can do in sets? How should we judge whether "class" rather than "set" is appropriate when describing a collection of sets? Thanks.

You need to learn what a set is first. Simply put something may or may not be a set. Really when we say X is a set we mean X is a set in some model of some axiomatic set theory. Confusing? Try this for starters:

www.maths.bris.ac.uk/~maxmg/maths/philosophy/sets.html[/URL]

Loosele, a Class is a collection of objects. Something is a set *in some model*, it's just an extra label that we can apply to a class.

For instance we agree that the rational numbers exist and have the properties we think they do? They also are a group. That is we can add the label "group" to them. But we had the rationals before the label group was invented...

Last edited by a moderator:
In my book, all the objects in the universe are sets. Classes are not necessarily objects. (Whether something is an object is the whole point.) Classes are extensions of properties (the class of all objects having some definite property). You basically start with a class and look at your axioms to determine whether the class is a set or not. So all sets are classes, but not all classes are sets. Those classes that aren't sets are called proper classes and cannot be members of any class or do anything that would make them a set, like being a subset of a set or whatever your rules say. For instance, the universe is usually a proper class. The empty class is usually a set.
So in the beginning, everything is a class. You then add some axioms, allowing some classes to be sets. At least, that's how I'd sum it up. If you want a more formal grounding, you can read a little about models, like matt says.

Last edited:
Demystifier

## 1. What is a class?

A class is a blueprint or template for creating objects in a programming language. It contains characteristics and behaviors that define the objects created from it.

## 2. What is a set?

A set is a collection of distinct objects or elements, where the order of the elements does not matter. It is often used in mathematics and computer science to represent a group of related objects.

## 3. What is the difference between a class and a set?

The main difference between a class and a set is that a class is a programming concept used to create objects with specific characteristics and behaviors, while a set is a mathematical concept used to group related objects. Classes are used in object-oriented programming, while sets are used in data structures and algorithms.

## 4. Can a class be considered a set?

No, a class cannot be considered a set as they serve different purposes and have different characteristics. A class has attributes and methods, while a set does not. Additionally, a set is a mathematical concept, while a class is a programming concept.

## 5. Can a set have objects of different classes?

Yes, a set can have objects of different classes as long as they are related in some way. For example, a set of all living organisms can contain objects of different classes such as mammals, birds, and fish. However, a class can only have objects of the same class.

• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
14
Views
4K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
• Computing and Technology
Replies
12
Views
791
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
10
Views
4K
• Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
9
Views
5K