Find Student Name Holding Highest Marks || List with Objects & Streams || Java Interview Question

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 22

  • @vengateshm2122
    @vengateshm2122 3 года назад +4

    Everyday brain refresher. In SQL world it would be like
    SELECT * FROM students where marks = (SELECT MAX (marks) FROM students)

  • @VineetKumar-eb3lv
    @VineetKumar-eb3lv 3 года назад +2

    Thank you Naveen !!!

  • @099aravintakshan7
    @099aravintakshan7 3 года назад +1

    hello sir i am a college students am so interested in java because of your videos keep posting more videos daily thank you sir

  • @karimmek1227
    @karimmek1227 3 года назад +1

    Thank you Naveen

  • @ashuiet
    @ashuiet 3 года назад

    I was practicing your SQL series...very nice you have explained everything...especially practicing in "XAMPP".

  • @tsr2819
    @tsr2819 2 года назад

    Thank you sir

  • @AnirudhGarg1123
    @AnirudhGarg1123 3 года назад

    Excellent!

  • @vinitp4559
    @vinitp4559 3 года назад +1

    Can you please also share video on lower java versions and the latest version and its new features and impact on legacy core Java code.. @Naveen pls?

  • @dipanshuvishwakarma6760
    @dipanshuvishwakarma6760 3 года назад

    Amazing sir

  • @Suganthdeepak
    @Suganthdeepak 3 года назад +1

    Wish u would have uploaded this video a day ago...The same exact question was asked to me in an interview on this Friday...Anyways..It s never too late...Thanks!

  • @muhammadsaqlain6251
    @muhammadsaqlain6251 3 года назад

    Sir please make a complete series on OOP in java...

  • @niravdaskubavat328
    @niravdaskubavat328 3 года назад

    please sir a series on java 8 features, including Stream API.

  • @sreevidyarejeesh8695
    @sreevidyarejeesh8695 3 года назад

    👍

  • @niravdaskubavat328
    @niravdaskubavat328 3 года назад

    Question: how can I find second highest number ?

    • @Rohit-fl6nl
      @Rohit-fl6nl 3 года назад +1

      Optional opt = studentList.stream().sorted(Collections.reverseOrder()).limit(2).skip(1).findFirst();
      System.out.println(Arrays.toString(opt))

    • @sanketnegi1
      @sanketnegi1 3 года назад

      1.Create an array..
      2. Use some sort (bubble sort)
      3.return arr[n-2]. (n is length)

    • @kalidasganesan
      @kalidasganesan Год назад +1

      // get max marks in the list
      int hm = sl.stream().map(e -> e.getMarks()).max(Integer::compare).get();
      System.out.println(hm);
      // Second highest
      sl.stream().filter(e -> e.getMarks() < hm).limit(1).forEach(e -> System.out.println(e.getName()));

  • @immortalhuman7085
    @immortalhuman7085 3 года назад +1

    why we used map method? You did not tell.

    • @kalidasganesan
      @kalidasganesan Год назад

      When we apply stream alone it will return stream of student objects and we cannot directly apply integer operations on stream objects, To convert stream object to integer he used map.

  • @yforyou1342
    @yforyou1342 3 года назад

    First comment