Go to IntelliJ and create a new Kotlin project. Create a new Kotlin file named Main.kt under the kotlin folder. Copy the following code and paste it into the file. val mutableEmptyList: MutableList<String> = mutableListOf(); fun main() { println(mutableEmptyList.isEmpty()); mutableEm...
#1540 com.alibaba.fastjson2.JSONException: create instance error class kotlin.collections.EmptyList, offset 32 at com.alibaba.fastjson2.reader.ObjectReaderImplList.readJSONBObject(ObjectReaderImplList.java:461) ~[fastjson2-2.0.34.jar:na]...
publicstaticvoidmain(String[]args){ArrayList<String>list=createList();String matchResult=null;for(inti=0;i<list.size();i++){if(list.get(i).contains("a")){matchResult=list.get(i);break;}}System.out.println(matchResult);}privatestaticArrayList<String>createList(){ArrayList<String>list=newArra...
privateconstvalTAG="Kotlin打印"privateconstvalc=3@Route(path="/main/kotlin03_activity")//ARouter库的注解,用来处理Activity之间的跳转classKotlin03:AppCompatActivity(){overridefunonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)setContentView(R.layout.activity_kotlin03)//变量variable...
public KtFile parseKotlinToPsi(@NonNull File file) { try { org.jetbrains.kotlin.com.intellij.openapi.project.Project ktProject = KotlinCoreEnvironment.Companion.createForProduction(() -> { }, new CompilerConfiguration(), CollectionsKt.emptyList()).getProject(); this.psiFileFactory = PsiFileFacto...
return emptyList() } } 注册Processor 实现了process后还需要把process注册一下,否则ksp plugin无法找到这个processor。在processor module与代码同级文件夹下新建文件『resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider』,然后把刚才实现的provider的完整类名,写在文件里,如果是使用...
publicKtFileparseKotlinToPsi(@NonNull File file){try{org.jetbrains.kotlin.com.intellij.openapi.project.Project ktProject=KotlinCoreEnvironment.Companion.createForProduction(()->{},newCompilerConfiguration(),CollectionsKt.emptyList()).getProject();this.psiFileFactory=PsiFileFactory.getInstance(ktProject);...
kotlinx.serialization also ships some deprecated Kotlin/Native targets that do not belong to any tier (e.g.iosArm32,mingwX86). We'll continue to release them, but we do not provide support for them, nor do we plan to add new targets from the deprecated list. ...
首先很高兴看到Google在I/O上官网宣布 Kotlin 成为 Android 的语言。我觉得既是大势所趋,也使得Android...
packagecom.llw.kotlinstartimportandroidx.appcompat.app.AppCompatActivityimportandroid.os.Bundleimportkotlinx.android.synthetic.main.activity_main.*classMainActivity:AppCompatActivity(){override funonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)val...