-1

ユーザーが入力した文字列と、日付からExcel値の文字列にフォーマットした別の文字列を比較したい。私はオブジェクトの配列を持っています。各オブジェクトには日付データがあります。ユーザーが入力した日付からこれらのオブジェクトを印刷したいと思います。しかし、オブジェクトのインデックスを見つけるために私が書いたメソッドは正しく機能していません。あなたが私を手に入れたことを願っています。これが私のコードです。`

System.out.print("Please enter a date:");
input = new Scanner(System.in);
String date1=input.next();
int index_tarih=searching(date1, myObjects);//myObjects is my array storing my data from excel.


public static int searching(String datess,sicaklik_nesne dayss[]) 
{   int number=0;

    for(int index_number=0;index_number<dayss.lenght;index_number++)
    {
       if(dayss[index_number].Gun==datess)
        {
            sayi=9;
        }
   }    

enter code here
    return sayi;
}   

`

i.Gun=new DataFormatter().formatCellValue(cell);// this code from my class retrieving excel data.
4

1 に答える 1