For this Question: Given two strings X and Y containing both uppercase and lowercase alphabets. The task is to find the length of the longest common substring.Input consist of two lines containing the strings X and Y respectively.

1 <= length(X), length(Y) <= 100Print in a single line the length of the longest common substring of the two strings.Input
abcdgh
acdghr

Output
4

Example:
Testcase 1: cdgh is the longest substring present in both of the strings., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String str2=br.readLine();
		int max_len=0;
		for(int i=0;i<str.length();i++)
		{
			for(int j=0;j<str2.length();j++)
			{
			int len=0;
			int u=i;
			while(i<str.length() && j<str2.length() && str.charAt(i)==str2.charAt(j))
			{
				len++;
				i++;
				j++;

			}
            i=u;


			if(max_len<len)
			max_len=len;
			}
		}
		System.out.println(max_len);

	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?