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...


What is the difference between Return Type Unit and Return Type Nothing in Kotlin?



What is the difference between Return Type Unit and Return Type Nothing in Kotlin?..

Answer / Rajesh Chauhan

Unit represents the absence of a return value, similar to void in Java. It is represented by the keyword 'unit'. On the other hand, Nothing is a special type that represents an unreachable state in the code. It signals a failure and cannot be used as a return type for normal functions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Kotlin Interview Questions

How to convert a String to an Integer?

1 Answers  


Describe the use of extension function?

1 Answers  


How does string interpolation work in Kotlin? Explain with a code snippet?

1 Answers  


What is the use of abstraction in Kotlin?

1 Answers  


Is it possible to migrate the code from Java to Kotlin?

1 Answers  


What is Kotlin’s target platform? Is Java-kotlin interoperability possible?

1 Answers  


What are the types of strings available in Kotlin? And, what do you mean by Kotlin String Interpolation?

1 Answers  


How to declare a Kotlin variable?

1 Answers  


Define step() function in Kotlin?

1 Answers  


Can kotlin code be executed without jvm?

1 Answers  


How do you export code from Java to Kotlin?

1 Answers  


How to handle null exceptions in Kotlin programming?

1 Answers  


Categories