07-20-2023, 04:30 PM
I want to assign my class variable in constructor, but I get an error 'expecting member declaration'
```kotlin
class YLAService {
var context:Context?=null
class YLAService constructor(context: Context) {
this.context=context;// do something
}
}
```
```kotlin
class YLAService {
var context:Context?=null
class YLAService constructor(context: Context) {
this.context=context;// do something
}
}
```