--- title: "Get a Segment Instance" url: https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/ description: "This page describes the method to get a cache segment instance in your Java application with sample code snippets." last_updated: 2025-11-19T15:07:41Z service: Cloud Scale type: general related_links: - name: "Cache" url: /en/cloud-scale/help/cache/introduction --- # Cache ### Get a segment instance The first step in referring to a cache segment is to create an empty segment instance using the `getSegmentInstance()` method which doesn't actually fire a server side call. This empty segment instance does not hold any values. #### Sample Code Snippet **Package Imports** ```java import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; ``` ```java //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegmentInstance(1510000000054091L); ```