I am unable to submitthis code (May I know what is the error)

import java.util.*;
public class Main
{
static Scanner scn=new Scanner(System.in);
public static void main(String args[])
{
// System.out.println(“Enter the string”);
String s=scn.nextLine();
dupFormat(s,0);
System.out.println(result);

}
static String result =" ";
public static void dupFormat(String s, int i)
{
	 result = result +s.charAt(i);
	
	if(i==s.length()-1)
	{
		return;
	}
	if(s.charAt(i)==s.charAt(i+1))
	{
		result = result +'*';
		
	}
	dupFormat(s,i+1);
	
}

}

Code submission not available or getting wrong answer?

I am getting the message as a wrong answer

For which all test cases?

the code is wrong with the dup() format
public static void dupFormat(String s, int i)
{
result = result +s.charAt(i);

if(i==s.length()-1)
{
	return;
}
if(s.charAt(i)==s.charAt(i+1))
{
	result = result +'*';
	
}
dupFormat(s,i+1);

}

Dry run this for aabccdd and you will know the error

Enter the string
aabccdd
aabccd*d
No sir, I am getting it right

When I compile and test the code I am getting the solution without any error.
But when I submitted the code it failed to qualify all the test cases

But your code is not giving this answer
Your code logic is wrong
Result is a string so it is immutable
Also your recursion is getting into infinite loop
Try making it iterative

Fine I will try that.
Thank you !