Can you write a Java function that checks whether or not an array of numbers contains any duplicate numbers and explain it?
system
kya aap ek java fnction likh sakate hai jo yah jaanchataa he ki sankhyaon kii ek sarani main koi dupliket number shaamil hai yaa nahin?
user
neeche die gaye fnction kaa naam "shaamil he" anurodhit oparation kaa pradarshan karegaa.

saarvajanik bulian main shaamil hai (int [] nums) {
        hashaset <intager> echem = nayaa hashaset ();
        for (int i = 0; i <nums.length; i ++) {
            if (hm.contains (nums [i])) {
                hm.add (nums [i]);
            }
            anya {
                sach lauten;
            }
        }
        vivaran jhootha he;
    }

shuru karne ke liye, fnction 'sammilit' hota he 'ek purnank sarani main "NUMS" naamak hota he.fnction main, ek hashaset banaaya jaataa he, yah hashaset un sankhyaon ke liye ek storage container ke rup main kaam karegaa jo isamen se pehle se nahin he.to, hamaare paas loop ke liye ek he jo sarani kii lambaai ke madhyam se punrariti karegaa, sarani ke bahut ant tak.prayek sankhya ke liye yah sarani main saamana karata he, ief statement yah dekhne ke liye ek check karegaa ki kya hashaset main pehle se hi us number main he.yadi nahin, to sankhya hashaset main shaamil ho jaaegi.ek baar joda gaya, loop ke liye vruddhi hogi or sarani main agle number par chale jaaenge.yadi loop ke liye ek sankhya kaa saamana kiye bina samaapt ho jaataa he jo pehle se hi hashaset main maujuud he, to fnction 'galat' lautataa he, or parinamswaroop koi dupliket nahin mila.yadi haalanki, sarani main ek sankhya hoti he jo pehle se hi hashaset main maujuud he, to fnction jaldi baahar nikal jayega or 'sahi' waapas aa jayega.
assistant
<|system|>
</s>
<|user|>
kya aap ek java fnction likh sakate hai jo yah jaanchataa he ki sankhyaon kii ek sarani main koi dupliket number shaamil hai yaa nahin?</s>
<|assistant|>
neeche die gaye fnction kaa naam "shaamil he" anurodhit oparation kaa pradarshan karegaa.

saarvajanik bulian main shaamil hai (int [] nums) {
        hashaset <intager> echem = nayaa hashaset ();
        for (int i = 0; i <nums.length; i ++) {
            if (hm.contains (nums [i])) {
                hm.add (nums [i]);
            }
            anya {
                sach lauten;
            }
        }
        vivaran jhootha he;
    }

shuru karne ke liye, fnction 'sammilit' hota he 'ek purnank sarani main "NUMS" naamak hota he.fnction main, ek hashaset banaaya jaataa he, yah hashaset un sankhyaon ke liye ek storage container ke rup main kaam karegaa jo isamen se pehle se nahin he.to, hamaare paas loop ke liye ek he jo sarani kii lambaai ke madhyam se punrariti karegaa, sarani ke bahut ant tak.prayek sankhya ke liye yah sarani main saamana karata he, ief statement yah dekhne ke liye ek check karegaa ki kya hashaset main pehle se hi us number main he.yadi nahin, to sankhya hashaset main shaamil ho jaaegi.ek baar joda gaya, loop ke liye vruddhi hogi or sarani main agle number par chale jaaenge.yadi loop ke liye ek sankhya kaa saamana kiye bina samaapt ho jaataa he jo pehle se hi hashaset main maujuud he, to fnction 'galat' lautataa he, or parinamswaroop koi dupliket nahin mila.yadi haalanki, sarani main ek sankhya hoti he jo pehle se hi hashaset main maujuud he, to fnction jaldi baahar nikal jayega or 'sahi' waapas aa jayega.</s>
