This file contains hidden or 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
| public class MyApplication extends Application { | |
| public void onCreate() { | |
| super.onCreate(); | |
| Stetho.initializeWithDefaults(this); | |
| } | |
| } |
This file contains hidden or 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
| fun main(args: Array<String>) { | |
| val range = 1..10000 | |
| logTime("benchmarkPlusOperator") { benchmarkPlusOperator(range) } | |
| logTime("benchmarkStringAppend") { benchmarkStringAppend(range) } | |
| } | |
| fun benchmarkPlusOperator(range:IntRange) { | |
| var str = "" | |
| range.forEach { str += "abc" } |
This file contains hidden or 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
| //BAD | |
| class Person () { | |
| private var weight:Double = 0 | |
| fun setWeight(weight:Double) { | |
| this.weight = weight | |
| } | |
| fun getWeight(): Double { | |
| return weight |
This file contains hidden or 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
| class Person (var name:String, var lastName:String, var weight:Double) { | |
| val fullName | |
| get() = "$name $lastName" | |
| } |
This file contains hidden or 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
| person.name = "Igor" | |
| person.weight = 79 | |
| person.jump() | |
| person.jump() | |
| person.jump() |
This file contains hidden or 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
| class Person (var name:String, var lastName:String, var weight:Double) { | |
| //.. | |
| fun jump() { | |
| weight -= 0.1 | |
| /*doSth*/ | |
| } | |
| } |
This file contains hidden or 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
| class Person () { | |
| fun run() { /*doSth*/ } | |
| fun walk() { /*doSth*/ } | |
| fun jump() { /*doSth*/ } | |
| } |
This file contains hidden or 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
| class Person (var name:String, var lastName:String, var weight:Double) { | |
| val fullName = "$name $lastName" | |
| } |
This file contains hidden or 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
| class Person (var name:String, var lastName:String, var weight:Double) |
This file contains hidden or 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
| universal: 1, 2, 3 | |
| x86: 100001, 100002, 100003 | |
| x86_64: 200001, 200002, 200003 | |
| armeabi-v7a: 300001, 300002, 300003 | |
| arm64-v8a: 400001, 400002, 400003 |