Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Does Kotlin have the static keyword? How to create static methods in Kotlin?



Does Kotlin have the static keyword? How to create static methods in Kotlin?..

Answer / Ravindra Kumar Tiwari

Kotlin does not have a direct equivalent of the Java 'static' keyword. Instead, you can use object or companion objects to achieve similar functionality. To create a static method, define it inside an object or companion object, and make sure that no instance variables are accessed within the function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Kotlin Interview Questions

what is the use of extension functions in Kotlin?

1 Answers  


What is the difference between inline and infix functions? Give an example of each.

1 Answers  


How to declare variable in Kotlin ?

1 Answers  


State the differences between val and var?

1 Answers  


Define step() function in Kotlin?

1 Answers  


What kinds of programming does Kotlin support ?

1 Answers  


What is the Elvis Operator?

1 Answers  


Can we migrate code from Java to Kotlin?

1 Answers  


Why do we need write open before class name in Kotlin while working on inheritance?

1 Answers  


What is the use of any() function?

1 Answers  


What is Data Class in Kotlin?

1 Answers  


How to compare two strings in Kotlin?

1 Answers  


Categories