Android
l3142600073
这个作者很懒,什么都没留下…
展开
-
Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts
打开App/Gradle Scripts/build.gradle(Project:---) Change the 'jcenter()' on build script{} and in all project repositories. and Sync now.更改之前:buildscript { repositories { google() jcenter() } dependencies { classpa...原创 2021-06-06 11:16:47 · 7488 阅读 · 3 评论 -
Android Kotlin 接口函数
1 调用接口中的函数//Person.ktpackage com.example.xhelloimport android.app.Personopen class Person (val name: String, val age: Int){}首先创建一个Study 接口,并在其中定义几个学习行为. 右击com.example.xhello包->NEW->kotlin File/Class 在弹出对话框中输入"Study", 创建 类型选择"Interface"//S原创 2020-06-22 23:05:15 · 379 阅读 · 0 评论 -
Android Kotlin继承
1 子类采用主构造函数//Person.ktpackage com.example.xhelloimport android.app.Personopen class Person { var name = "" var age = 0 fun eat() { println(name + "is eating. He is + " + age + "years old.") }}//Student.ktimport android.ap原创 2020-06-22 22:44:28 · 205 阅读 · 0 评论 -
Android 面向对象编程 类与对象
首先创建一个 person 类, 右击 com.example.xhello包 ->Kotlin File/Class, 在 弹出框中输入"Person". 对话在默认情况下自动创建一个 File, File 通常用于编写Kotlin 顶层函数和扩展函数,可以点击展开下拉列表进行切换, 如下图:参考:<<第一行代码>> 第三版...原创 2020-06-21 18:10:21 · 480 阅读 · 0 评论