constructors
This commit is contained in:
14
rust/Constructors.md
Normal file
14
rust/Constructors.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Constructors in rust
|
||||
|
||||
Rust is a special case for constructors. The language itself is already
|
||||
different from most other languages in structure, especially for object oriented
|
||||
programming.
|
||||
|
||||
Simply said, there are no constructors in rust. When you create an object, you
|
||||
have to initialize all data immediately and by yourself.
|
||||
|
||||
You can look into the classes or instances examples to see how object
|
||||
construction is done in rust.
|
||||
|
||||
- [main.rs](./classes/src/main.rs)
|
||||
- [car.rs](./classes/src/car.rs)
|
Reference in New Issue
Block a user