First Unique Character in Java by frequency I have completed an implementation for finding the first unique character.
Is there any way I can improve it?
package com.datastructures;

public class FirstUniqueCharacter {

    public static void main(String args[]){

        String string = &quot;neslihan&quot;;
        System.out.println(firstUniqueChar(string));
    }

    private static int firstUniqueChar(String string) {

        int freq[] = new int[26];

        for(int i=0; i&lt; string.length() ;i++){
            freq[string.charAt(i) - 'a'] ++;
        }
        for (int j =0;j&lt;string.length();j++){
            ;
            System.out.println(string.charAt(j)-0);
            System.out.println('a'-0);
            if(freq[string.charAt(j) - 'a'] == 1) {
                return j;
            }
        }
        return -1;
    }
}
As from @RobAu 's comment the title is misleading because you returns the index of the first unique character in your frequencies array so that the index 0 refers to the 'a' char, 1 refers to the 'b' char, etc., making the assumption that your string just contains only letter chars coerent with the ascii table.
In your code you make use of string methods length() and charAt to iterate over the string , you can iterate directly over one char array like below:
private static int firstUniqueChar(String string) {
    int freq[] = new int[26];
    char[] arr = string.toCharArray();

    for(char c : arr) { ++freq[c - 'a']; }

    //other instructions
}

You are using subtraction by 0 in these lines:
System.out.println(string.charAt(j)-0);
System.out.println('a'-0);

I presume you are using this subtraction because you want to print the int value of the char, you can solve this issue casting the char value to int. Below my version of your code:
private static int firstUniqueChar(String string) {
    int freq[] = new int[26];
    char[] arr = string.toCharArray();

    for(char c : arr){
        ++freq[c - 'a'];
    }
        
    for (int j =0;j &lt; arr.length; ++j){

        System.out.println((int) arr[j]);
        System.out.println((int) 'a');

        if(freq[arr[j] - 'a'] == 1) {
            return j;
        }
    }
    
    return -1;
}

From your code I have the impression at the moment you are mixing different concepts in an unclear manner.