Savol: Talabalar ismlarini alifbo tartibida saralash


Download 58.91 Kb.
Sana05.12.2020
Hajmi58.91 Kb.
#160711
Bog'liq
AL lab-1


AL lab-1

Rizoyev Sunnatillo

Savol:

Talabalar ismlarini alifbo tartibida saralash:



Dastur kodi:

package com.company;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

public class Main {

public static void main(String[] args) {

ArrayLista=new ArrayList();


a.add("Sunnat");
a.add("Nurbek");
a.add("Rashid");
a.add("Abdulaziz");
a.add("Muhammad");
System.out.println(a);
Collections.sort(a);
System.out.println("saralashdan keyin:");
System.out.println(a);
}
}

natijasi:




Download 58.91 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling