From Java to Kotlin Cheat Sheet

Related tags

Kotlin kotlin java
Overview

From Java to Kotlin Cheat Sheet

Page: http://fabiomsr.github.io/from-java-to-kotlin/

Programmatically inspired from swift-is-like-go and visually inspired from swiftislikescala

License

MIT

Develop

npm i # install dependencies to build tools
./make.coffee dev # build html

HTML is generated from cirru/index.cirru, cirru/functions.cirru and cirru/classes.cirru. Read those files and you would know what's happening.

Comments
  • Mistake in Generic Methods category

    Mistake in Generic Methods category

    There is mistake in this category. In Java section we have method createList, but called only create. In Kotlin section there is no mistake.

    Screenshot

    opened by MenosGrante 2
  • Replace range with until function that does not include its end element

    Replace range with until function that does not include its end element

    for-in-until was included in Kotlin 1.1.4 and it's offers optimizations for right-exclusive loops (ref.).

    I am opening this PR to change the right-exclusive loop example in Kotlin using until instead of ranges.

    opened by wesjon 1
  • Top navigation doesn't indicate in which section you're in

    Top navigation doesn't indicate in which section you're in

    Take a look at the image below. As you can see there is no way of telling in which section you're in. Users might miss checking other sections if they don't realize these are navigation links.

    image

    My suggestion is to add a selected state, a line below the current section or a different background, to the current section.

    opened by wesjon 1
  • remove unnecessary `internal` modifier, as it refers to a module

    remove unnecessary `internal` modifier, as it refers to a module

    internal is not the same as Java's package-private. From the docs:

    The internal visibility modifier means that the member is visible with the same module. More specifically, a module is a set of Kotlin files compiled together:

    • an IntelliJ IDEA module;
    • a Maven or Gradle project;
    • a set of files compiled with one invocation of the Ant task.
    opened by lmller 1
  • Java 9 Collections factory methods.

    Java 9 Collections factory methods.

    This pull request simplifies the collection creation with features from Java 9 (not yet released). You can merge it whenever you feel like Java 9 is standard enough to. I hope this helps!

    Thanks, Eli

    opened by EtherTyper 1
  • A couple of issues

    A couple of issues

    • val name = null is of type Nothing?
    • The multi line string will contain a lot of whitespace if you don't call trimMargin
    • The when snippet is wrong. The branch isOdd(x) will never be triggered because it compares the value of the string x to the boolean result of the call. If you want to have method calls in the when branches, you need to pull the argument out of the when-expression.
    • The correct name for "Tuples" is "Data Classes" paired with "Destructuring". Tuples are something different.
    • The correct name for "Object instance" is "Constructor call"
    • You can leave out the body of a class if it's empty
    • The correct name for "Attributes" is "Primary Constructor"
    • A better name for "Multiple Constructors" is "Optional Arguments in Constructors (as alternative to overloaded constructors)"
    opened by cypressious 1
  • Update null-ii.java to be consistent with kotlin

    Update null-ii.java to be consistent with kotlin

    The kotlin code assigns null to length if text is null. The old java code declared length in a different scope and never declared length when text was null.

    opened by stevenwaterman 0
Owner
Fabio Santana
Medium: medium.com/@xenss Twitter: twitter.com/XensS
Fabio Santana
This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.

Localize your application content This program will read from your application string.xml file and generate translated strings.xml files in your prefe

DhiWise 4 Jul 29, 2022
Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice

SpinnerDialog Android Spinner Dialog Library, Use for single or multi selection of choice Android UI Download To include SpinnerDialog in your project

Hamza Khan 55 Sep 15, 2022
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Codename One - Cross Platform Native Apps with Java or Kotlin Codename One is a mobile first cross platform environment for Java and Kotlin developers

Codename One 1.4k Jan 9, 2023
StaticLog - super lightweight static logging for Kotlin, Java and Android

StaticLog StaticLog is a super lightweight logging library implemented in pure Kotlin (https://kotlinlang.org). It is designed to be used in Kotlin, J

Julian Pfeifer 28 Oct 3, 2022
Auto-generate the fastest possible Parcelable implementations for Java and Kotlin

This project is deprecated It will still be maintained, but no new features will be added. Please use Parcelize, as it is the official way of generati

Bradley Campbell 492 Nov 17, 2022
Transform java callback to kotlin suspend method.

Callback2Coroutines Transform Java callback to coroutines suspend method. 将传统Java callback 方法转换为kotlin中的suspend方法。 接入指南 根目录下加入jatpack的repository: allp

RainFool 14 May 25, 2021
A Kotlin compiler plugin that allows Java callers to pass in null for default parameters

kotlin-null-defaults (Compiler plugin) (Gradle Plugin) ( Currently pending approval) A Kotlin compiler plugin that allows Java callers to pass in null

Youssef Shoaib 7 Oct 14, 2022
🔨 Template for easy hosting of your Java/Kotlin libraries on GitHub

?? kotlin-jvm-library-template Another template for easy hosting your Java/Kotlin libraries on GitHub. Features boilerplate for Kotlin/Java projects w

Viktor 0 Jan 7, 2022
Kotlin and Java API for generating .swift source files.

SwiftPoet SwiftPoet is a Kotlin and Java API for generating .swift source files. Source file generation can be useful when doing things such as annota

Outfox 232 Jan 2, 2023
Sample Code for fake Kotlin library written in Java

Jatlin このリポジトリは ブログ記事 のためのサンプルコードです。詳細は記事をご覧ください。 プロジェクト構成 :java-lib にKotlinに偽装したJavaファイルが含まれます。 :kotlin-lib は :java-lib をビルドしたJARファイルをKotlinから読み込んで実行

Takaki Hoshikawa 3 Dec 10, 2021
Greatly simplifies the complexities of Kotlin's reflection of Java

CatReflect 这是一个可以极大简化 Java 反射的复杂操作的工具,适用于 Kotlin & Java This is a tool that grea

null 0 Dec 26, 2021
Unofficial Actions on Google SDK for Kotlin and Java

Actions On Google Client Library This is a port of the official Node.js SDK to Kotlin. This can also be used from Java and any JVM language. Quick Fac

Ticketmaster® & Live Nation Entertainment® 118 Oct 3, 2022
Theia - A Kotlin program used to analyze and discover backdoors in Minecraft Java 1.12.2 forge mods

Theia A Kotlin program used to analyse and discover backdoors in Minecraft Java

null 7 Jan 13, 2022
A tool that can mock out an existing Appium session, supports both Java and Kotlin.

appium-mocker A tool that can mock out an existing Appium session, supports both Java and Kotlin. How to install latest appium-mocker Beta/Snapshots <

aaronLLL 21 Jun 8, 2022
A Java Virtual Machine written in Kotlin

jvm.kotlin A Java Virtual Machine written in Kotlin. Introduction jvm.kotlin is a toy JVM programmed in Kotlin. The main purpose of this project is le

Elements 14 Aug 13, 2022
Java REPL on Android with BeanShell

BeeShell Java REPL on Android with BeanShell. Useful for quickly checking some framework API behavior, or calling Java APIs with the permissions of AD

Hai Zhang 67 Dec 26, 2022
This repository is part of a Uni-Project to write a complete Compiler for a subset of Java.

Compiler This repository is part of a Uni-Project to write a complete Compiler for a subset of Java. Features error recovery using context sensitive a

null 3 Jan 10, 2022
Write a Ghidra Extension without using Java or Eclipse!

Ghidra Extension in Kotlin using IntelliJ IDEA Write a Ghidra Extension without using Java or Eclipse! Setup Hit Use this template at the top of the r

Florian Magin 7 Dec 15, 2022
A library for building Java only Zygisk/Riru modules.

A library for building Java only Zygisk/Riru modules.

Kr328 19 Dec 17, 2022