# Help I want to understant Client.java source code

**URL:** <https://discuss.elastic.co/t/help-i-want-to-understant-client-java-source-code/26264>\
**Category:** Elasticsearch\
**Created:** [July 24, 2015, 7:23pm UTC](https://discuss.elastic.co/t/help-i-want-to-understant-client-java-source-code/26264 "2015-07-24T19:23:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish\_Kumar1](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@Manish\_Kumar1](https://discuss.elastic.co/u/Manish_Kumar1)\
**Post date:** [July 24, 2015, 7:23pm UTC](https://discuss.elastic.co/t/help-i-want-to-understant-client-java-source-code/26264/1 "2015-07-24T19:23:14Z")

</div>

I was going through the [Client.java](https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/client/Client.java) source code just to learn coding.

lets take on method as example

```
client.prepareIndex(index, type)

```

Its return type is IndexRequestBuilder. My question is in **Client.java** its simply

```
> IndexRequestBuilder prepareIndex(String index, String type);

```

So where is the implementation for this method ? When I call **client.prepareIndex(index, type)** which implementation is called and why it written like this ?

What i know from my knowledge about using interface is something like this :

```
publi interface Y
{
  public void f();
} 

publi class X implements Y
{
      public void f()
      {
            // .....
      }
} 

```

Now I call it like

```
Y ob = new X();
ob.f();

```

But in ES when i call some Client.java method I am not understanding how it resolve the method call and where is the method implementation of Client.java

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:59pm UTC](https://discuss.elastic.co/t/help-i-want-to-understant-client-java-source-code/26264/2 "2017-07-05T23:59:10Z")

</div>


