Closed ChAoSUnItY closed 2 years ago
self
rust
impl Main { pub fn hello(self, s: str[]) { //... } }
impl Main { pub fn hello(s: str[]) { //... } }
impl
impl Main { comp { System.out.println("Hello"); } }
The above example does the same thing as the following Java code:
class Main { static { System.out.println("Hello"); } }
self
keyword in parameter list likerust
does:self
in parameter list:impl
block like Java's static blockThe above example does the same thing as the following Java code: