-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb19e0a
commit 042e0c2
Showing
13 changed files
with
232 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
public class StaticFields { | ||
|
||
private static int resultSub; | ||
private static int resultAdd; | ||
private static int resultMul; | ||
|
||
public static void main(String[] args) { | ||
int first = 11; | ||
int second = 1000; | ||
sub(first, second); | ||
add(first, second); | ||
mul(first, second); | ||
int result = resultSub + resultAdd + resultMul; | ||
} | ||
|
||
public static void sub(int first, int second) { | ||
resultSub = first - second; | ||
} | ||
|
||
public static void add(int first, int second) { | ||
resultAdd = first + second; | ||
} | ||
|
||
public static void mul(int first, int second) { | ||
resultMul = first * second; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#[derive(Debug)] | ||
pub(crate) struct Field { | ||
value: i32, // todo: support other types | ||
} | ||
|
||
impl Field { | ||
pub fn new() -> Self { | ||
Self { value: 0 } | ||
} | ||
|
||
pub fn set_value(&mut self, value: i32) { | ||
self.value = value; | ||
} | ||
|
||
pub fn value(&self) -> i32 { | ||
self.value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub(crate) mod field; | ||
pub(crate) mod java_class; | ||
pub(crate) mod java_method; | ||
pub(crate) mod method_area; | ||
|
Oops, something went wrong.