# @JvmOverloads for Android Views

DevFeed: [@JvmOverloads for Android Views](<https://devfeed.tech/articles/jvmoverloads-for-android-views-27065.md>)

Original publisher: [Read original article](<https://zsmb.co/jvmoverloads-for-android-views/>)

Author: Márton Braun

Published: 2019-02-22T11:00:00Z

Content type: tutorial

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [convenience](<https://devfeed.tech/tags/convenience.md>), [feature](<https://devfeed.tech/tags/feature.md>), [framework](<https://devfeed.tech/tags/framework.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [marton-braun](<https://devfeed.tech/tags/marton-braun.md>), [zsmb](<https://devfeed.tech/tags/zsmb.md>), [zsmb-co](<https://devfeed.tech/tags/zsmb-co.md>), [zsmb13](<https://devfeed.tech/tags/zsmb13.md>), [zsmbco](<https://devfeed.tech/tags/zsmbco.md>)

## AI overview

This tutorial explains how Kotlin's @JvmOverloads annotation generates Java-compatible overloads and examines why using it for Android custom View constructors can produce behavior different from explicitly defining the constructors.

## Source excerpt

The @JvmOverloads annotation is a convenience feature in Kotlin for interoperating with Java code, but there is one specific use case on Android where it shouldn't be used carelessly.