---
title: "Discussion on \"Pair and Triple in kotlin\" | Hashnode"
description: "Discussion on \"Pair and Triple in kotlin\". Whenever we want to return two values from a function, we make classes for that \nbut creating too many classes can make your code inefficient.\nSo, Instead of creating classes for two or more values, you can use Pair for \nreturning or using two values..."
url: "https://hashnode.com/posts/pair-and-triple-in-kotlin/62c324dfccecfb25bbc795da"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Pair and Triple in kotlin](https://shivam-gupta.hashnode.dev/pair-and-triple-in-kotlin?utm_source=hashnode&utm_medium=feed)

Whenever we want to return two values from a function, we make classes for that but creating too many classes can make your code inefficient. So, Instead of creating classes for two or more values, you can use Pair for returning or using two values...

Jul 4, 2022 · 2 min read · shivam-gupta.hashnode.dev  
Updated Jul 14, 2022  
Read the article

-   [#kotlin](https://hashnode.com/tag/kotlin)
-   [#kotlin-beginner](https://hashnode.com/tag/kotlin-beginner)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#coding](https://hashnode.com/tag/coding)
-   [#pair](https://hashnode.com/tag/pair)

## Written by

[Shivam Gupta](https://hashnode.com/@sgdev07)

@sgdev07 · India

  
[View profile](https://hashnode.com/@sgdev07)

Android developer

I am Shivam Gupta, an enthusiastic Android developer who enjoys learning the art of making apps. I like to explore, experiment, and share my knowledge. I love to read books, talk to people and solve problems.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
