Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
IMAPプロトコルを使用して、Javaメールを使用してGoogleサーバーからメールをフェッチしています。取得したメールは降順で表示されます。到着日に基づいて最初に最新のメールを取得するにはどうすればよいですか?
メッセージは到着時に保存されます。番号が最も大きいメッセージは最新のものである必要があります。逆の順序でアクセスするだけです。
forループの順序を逆にして、forループを次のように開始できます。
for(int i=messages.length -1; i>=0; i--){}
それが役に立てば幸い