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

Can you execute Kotlin code without JVM?

1 Answers  


Can you migrate the code from java to kotlin? If yes how do you do it?

1 Answers  


How Kotlin works?

1 Answers  


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

1 Answers  


Give example to declare variable using both val and var in Kotlin?

1 Answers  


What are High-Level Functions in Kotlin?

1 Answers  


What is Ranges operator in Kotlin?

1 Answers  


What is the Elvis Operator?

1 Answers  


Explain the use of extension functions

1 Answers  


List the Basic data types of Kotlin?

1 Answers  


Which type of programming does kotlin support?

1 Answers  


Why is Kotlin preferred over Java? Important benefits of kotlin?

1 Answers  


Categories