How to delete an element from an array in java?

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ค. 2024
  • deleting an element from an array in java,
    program to delete an element in an array,
    remove a specific element from an array in java,
    can we remove element from array in java,
    how remove element from array in java,
    java delete an element from an array,
    javascript delete an element from an array,
    delete element from array java by index,
    how to remove a element from array in java,
    delete an element from array java,
    can we delete an element from an array in java,
    remove duplicate element from an array in java

ความคิดเห็น • 15

  • @LinyueWeng
    @LinyueWeng 15 วันที่ผ่านมา

    what if there are more than 1 element of which you want to remove in the array? (i.e. {1, 2, 3, 3, 4} with element being 3)

  • @rachamallidorasrivignesh4499
    @rachamallidorasrivignesh4499 2 หลายเดือนก่อน

    Thank you so much for great explanation.

  • @Anitha.D
    @Anitha.D 7 หลายเดือนก่อน

    Thank you

  • @aigulidrisova1126
    @aigulidrisova1126 ปีที่แล้ว

    👍

  • @shivarajyadachi1842
    @shivarajyadachi1842 10 หลายเดือนก่อน

    sir, please catch the AIOB execption in case element not found

    • @ShubhamPatil-rl4jk
      @ShubhamPatil-rl4jk 5 หลายเดือนก่อน

      you must have not used same name in the method signature?

  • @malayapanda9040
    @malayapanda9040 4 หลายเดือนก่อน

    Dynamic code likhiye naa..

  • @maestradolouiegerard7881
    @maestradolouiegerard7881 2 หลายเดือนก่อน

    What IDE do you use?

    • @bandiraghu
      @bandiraghu 2 หลายเดือนก่อน

      I think it is Eclipse IDE

  • @prajwalkande5879
    @prajwalkande5879 6 หลายเดือนก่อน +7

    Little bit easier one!!
    public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);

    int a[ ]= {1,2,3,4,5,2};
    System.out.println("enter element to be deleted:-");
    int b= sc.nextInt();

    for(int i=0;i

    • @keerthishanbhag1137
      @keerthishanbhag1137 6 หลายเดือนก่อน +1

      Here you are not deleting but just printing

    • @utkarshtyagi6104
      @utkarshtyagi6104 5 หลายเดือนก่อน

      he is doing the same
      @@keerthishanbhag1137

  • @sainath2983
    @sainath2983 2 หลายเดือนก่อน

    public class Program
    {
    static void Main(string[] args)
    {
    int[] nums = { 1, 2,3,4,5,6,7,8,9,10 };
    int x = 3;
    List list = new List();
    for(int i = 0; i < nums.Length; i++)
    {
    if(x != nums[i])
    {
    list.Add(nums[i]);
    }
    }
    foreach(int i in list)
    {
    Console.WriteLine(i);
    }
    }
    }

  • @bhaveerathod2373
    @bhaveerathod2373 3 หลายเดือนก่อน

    YOU SAVED ME BRO OMG I WISH I SAW THIS 10 MINUTES AGO BEFORE MY DUE DATE
    thank you so so soooooo much i subscribed because of this 🥹🥹🥹🥹👏👏
    I'm still so sad because it's 12 am and my mind isn't working properly if i thought to search this up earlier in stead of trouble shooting I could have submitted my assignment before the deadline.
    The only thing I struggled with was not adding the "index" variable like you did, so i kept getting out of bounds error. And i had so much time that I wasted so now it's late, but better late than never i guess

  • @samahmahdi5511
    @samahmahdi5511 4 หลายเดือนก่อน

    Thank you