Hi
Can someone explain to me why when i compare the array values for my code below,if i use "==",it will only compare 1 time.
However,if i use ".equals", it will work correctly.
import java.util.Scanner;
import java.util.Arrays;
class normalsorting
{
public static void main(String args[])
{
String input;
System.out.print("Enter Jumbled Up Number(Eg:2,6,8,4):");
Scanner sc = new Scanner(System.in);
input = sc.nextLine();
String store [] = input.split(",");
for(int i=0; i < store.length; i++)
{
int counter = 0;
for(int j=0; j < store.length; j++)
{
if (store[i] == store[j])
{
counter++;
System.out.println(counter);
}
}
}