# Mixing interfaces and classes with Expect/Actual & Java interop

**URL:** <https://discuss.kotlinlang.org/t/mixing-interfaces-and-classes-with-expect-actual-java-interop/28717>\
**Category:** Multiplatform\
**Created:** [June 4, 2024, 11:05pm UTC](https://discuss.kotlinlang.org/t/mixing-interfaces-and-classes-with-expect-actual-java-interop/28717 "2024-06-04T23:05:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oglassdev](https://avatars.discourse-cdn.com/v4/letter/o/9fc348/32.png) [@oglassdev](https://discuss.kotlinlang.org/u/oglassdev)\
**Post date:** [June 4, 2024, 11:05pm UTC](https://discuss.kotlinlang.org/t/mixing-interfaces-and-classes-with-expect-actual-java-interop/28717/1 "2024-06-04T23:05:35Z")

</div>

Hello all

I’m currently writing a “multiplatform” Minecraft Inventory GUI library with two JVM targets - Minestom and Paper. I’m currently trying to reduce my generics by using Kotlin multiplatform.

I need to fill in type parameters based on the platform being used. In Minestom, there is net.minestom.server.item.ItemStack, which is an interface. Paper’s ItemStack is a class. This arises an issue when I do

expect class Display

actual typealias Display = net.minestom.server.item.ItemStack

actual typealias Display = org.bukkit.inventory.ItemStack

All I need is to use it in my Widgets as a factory, like so  
class Widget {  
val display: Display  
}

Is there a way to do this or another method I can use to get the same functionality? Thank you
