Anagram word in java

import java.io.*;
class Main
{
public static void main(String[] args)throws IOException
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));

System.out.println("enter a word");
String w=br.readLine();
int l=w.length();
for(int i=0;i<l;i++)
{
for(int j=0;j<l;j++)
{
for(int k=0;k<l;k++)
{
for(int t=0;t<l;t++)
{
if(i!=j && i!=k && i!=t && j!=k && j!=t && k!=t)
{
System.out.println(w.charAt(i)+""+w.charAt(j)+""+w.charAt(k)+""+w.charAt(t));
}
}
//System.out.println();
}
}
}

}
}

Second largest number in java using ternary operator

 //Largest second number using ternary operator public class Main { public static void main(String[] args) { int a=5,b=6,c=7; int ...