extra info for other languages
This commit is contained in:
parent
4a9de2897c
commit
551e8835d7
@ -3,6 +3,7 @@
|
||||
|
||||
int main() {
|
||||
// create a new car and store it in the variable 'a'
|
||||
// in contrast to java, c++ does not need initialization with the 'new' keyword here.
|
||||
car a;
|
||||
// set some data for that car
|
||||
a.manufacturer = "Benz";
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
|
||||
Basic Car class
|
||||
just here to make the demonstration in the main file possible
|
||||
|
5
java/instances/README.md
Normal file
5
java/instances/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Java Example
|
||||
|
||||
Relevant Files:
|
||||
|
||||
- [main.java](./main.java)
|
10
rust/instances/README.md
Normal file
10
rust/instances/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Rust Example
|
||||
|
||||
## Language specific
|
||||
|
||||
- Rust doesn't use the 'new' keyword
|
||||
- Classes in Rust require all attributes to be defined at all times, so you have to define all the data on creation.
|
||||
|
||||
Relevant Files
|
||||
|
||||
- [main.rs](./src/main.rs)
|
@ -3,6 +3,8 @@ use car::Information;
|
||||
|
||||
fn main() {
|
||||
// create a new car and store it in the variable 'a'
|
||||
// rust also doesn't use the 'new' keyword
|
||||
// all attributes have to be defined upon creation of the object
|
||||
let a = car::Car {
|
||||
// set some data for that car
|
||||
manufacturer: "Benz".to_string(),
|
||||
|
5
typescript/instances/README.md
Normal file
5
typescript/instances/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Typescript Example
|
||||
|
||||
Relevant Files
|
||||
|
||||
- [index.ts](./index.ts)
|
Loading…
x
Reference in New Issue
Block a user