Compare commits
No commits in common. "551e8835d78b000365eea4a51965f91ddb2c04ef" and "cbfbdab6c4baec0f35c459f1dffbc84ba4e9cc4c" have entirely different histories.
551e8835d7
...
cbfbdab6c4
@ -1,11 +0,0 @@
|
||||
# C++ Example
|
||||
|
||||
## Language Specific
|
||||
|
||||
c++ is almost identical to java in this example.
|
||||
The only difference here is that c++ doesn't require the object
|
||||
to be initialized with the keyword 'new'.
|
||||
|
||||
Relevant Files:
|
||||
|
||||
- [main.cpp](./main.cpp)
|
@ -3,12 +3,11 @@
|
||||
|
||||
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;
|
||||
car a;
|
||||
// set some data for that car
|
||||
a.manufacturer = "Benz";
|
||||
a.model = "Velo";
|
||||
|
||||
|
||||
// do the same for a second car
|
||||
car b;
|
||||
b.manufacturer = "Ford";
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
|
||||
Basic Car class
|
||||
just here to make the demonstration in the main file possible
|
||||
|
@ -1,5 +0,0 @@
|
||||
# Java Example
|
||||
|
||||
Relevant Files:
|
||||
|
||||
- [main.java](./main.java)
|
@ -64,7 +64,7 @@ repository :)
|
||||
|
||||
## Examples
|
||||
|
||||
- [Java](../java/instances/README.md)
|
||||
- [Rust](../rust/instances/README.md)
|
||||
- [C++](../cpp/instances/README.md)
|
||||
- [JavaScript (using TypeScript)](../typescript/instances/README.md)
|
||||
- [Java](../java/instances)
|
||||
- [Rust](../rust/instances)
|
||||
- [C++](../cpp/instances)
|
||||
- [JavaScript (using TypeScript)](../typescript/instances)
|
||||
|
@ -1,10 +0,0 @@
|
||||
# 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,8 +3,6 @@ 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(),
|
||||
|
@ -1,5 +0,0 @@
|
||||
# Typescript Example
|
||||
|
||||
Relevant Files
|
||||
|
||||
- [index.ts](./index.ts)
|
Loading…
x
Reference in New Issue
Block a user