Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

kotlin static method

class Foo {
  companion object {
     fun a() : Int = 1
  }
}

Foo.a()
Comment

calling java static method in kotlin

//Java class
public class Foo {
  //static Method
    public static void printFoo() {
        System.out.println("foo");
    }
}

// calling Java static method in Kotlin
fun main(args: Array<String>) {
    Foo.printFoo()
}
Comment

PREVIOUS NEXT
Code Example
Java :: android activity keyboard hide 
Java :: How to make a Java Main Menu Loop after using a case 
Java :: calendar check if month is 30 days 
Java :: Implementation of TreeMap Class in Java map 
Java :: Explain JDK, JRE and JVM? 
Java :: treeset java descending order using comparator 
Java :: for loop condition java 
Java :: why are my if statements not working with inputs in java 
Java :: String Reverse Program in Java. 
Java :: treemap java entryset 
Java :: char value java 
Java :: spring boot api key authentication example 
Java :: split in java 
Java :: next method jdbc 
Java :: split string to textview in android 
Java :: Write code to declare an array that will hold calendar months (.e. January to December) java 
Java :: The superclass "jakarta.servlet.http.HttpServlet" was not found on the Java Build Path 
Java :: java try...catch 
Java :: java list iterator example 
Java :: java load jar at runtime 
Java :: Java Define a Functional Interface in java 
Java :: how to find a word in a statement java 
Java :: how to take binary input in java 
Java :: MD5 java 
Java :: java boolean data type 
Java :: how to add element to dictionary 
Java :: how to get length of 2d array java 
Java :: java hex to rgb 
Java :: insert node at end of doubly linked list 
Java :: array buffer 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =