Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //DeviceAndriod.java
- class DeviceAndriod {
- print(x){
- nativePrintCommand(x);
- }
- }
- //DeviceIOS.cpp
- class DeviceIOS{
- print(x){
- nativePrintCommand(x);
- }
- }
- //IDevice.hx
- interface IDevice{
- print();
- }
- //DeviceAndriod .hx
- import DeviceAndriod.java as DeviceAndriodJava;
- class DeviceAndriod implements IDevice{
- print(x){
- DeviceAndriodJava.print(x);
- }
- }
- //DeviceIOS.hx
- import DeviceIOS.cpp DeviceIOSCpp;
- class DeviceIOS implements IDevice{
- print(x){
- DeviceIOSCpp.print(x);
- }
- }
- @if java
- import device from DeviceAndriod
- @else
- import device from DeviceIOS
- class Main {
- run(){
- device.print(123);
- }
- }
- // Compile to Haxe to Java or Cpp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement