first you should run this code than you will automatically understand .
#include<stdio.h>
int main()
{
char s[15]="Sreeja";
char t[15]="Mukherjee";
printf("start address value of S= %d\n",s);
printf("start address value of t=%d\n",t);
if(s>t)
printf("s>t");
else
printf("s<t");
}
In the case of String the compiler compare the address of starting character.(In the case of C)
if you want to read about java than you should check this linkhttps://www.javatpoint.com/string-comparison-in-java