An operation method of an electronic device, the method comprising: determining (901, 1001) through an object sensor (411, 512) if an object is detected at a first terminal (302, 402, 502, 602, 702, 802) among a plurality of terminals of an ear jack (301, 401, 501, 601, 701, 801) based on sensing a first variation of a first impedance between a first side and a second side of the first terminal (302, 402, 502, 602, 702, 802); determining (901, 1001) if an object is detected at a second terminal (304, 404, 504, 604, 704, 804) among a plurality of terminals of an ear jack (301, 401, 501, 601, 701, 801) based on sensing a second variation of a second impedance between a first side and a second side of the second terminal (304, 404, 504, 604, 704, 804); in response to determining that the object is detected at the first terminal and the second terminal, calculating (902, 1002) through an impedance detector (310, 410, 507, 610, 710, 810) a third impedance of the second terminal; determining (903, 1003) a type of the object according to the third impedance from among an earplug or moisture; wherein determining (903, 1003) the type of the object comprises: if the third impedance is greater than or equal to a predetermined value, determining that moisture is in the ear jack (301, 401, 501, 601, 701, 801); or if the third impedance value is less than the predetermined value, determining that an earplug is in the ear jack (301, 401, 501, 601, 701, 801); and wherein the first terminal is a left terminal (302, 402, 502, 602, 702, 802), and the second terminal is a ground terminal (304, 404, 504, 604, 704, 804). determining (901, 1001) through an object sensor (411, 512) if an object is detected at a first terminal (302, 402, 502, 602, 702, 802) among a plurality of terminals of an ear jack (301, 401, 501, 601, 701, 801) based on sensing a first variation of a first impedance between a first side and a second side of the first terminal (302, 402, 502, 602, 702, 802); determining (901, 1001) if an object is detected at a second terminal (304, 404, 504, 604, 704, 804) among a plurality of terminals of an ear jack (301, 401, 501, 601, 701, 801) based on sensing a second variation of a second impedance between a first side and a second side of the second terminal (304, 404, 504, 604, 704, 804); in response to determining that the object is detected at the first terminal and the second terminal, calculating (902, 1002) through an impedance detector (310, 410, 507, 610, 710, 810) a third impedance of the second terminal; determining (903, 1003) a type of the object according to the third impedance from among an earplug or moisture; wherein determining (903, 1003) the type of the object comprises: if the third impedance is greater than or equal to a predetermined value, determining that moisture is in the ear jack (301, 401, 501, 601, 701, 801); or if the third impedance value is less than the predetermined value, determining that an earplug is in the ear jack (301, 401, 501, 601, 701, 801); and if the third impedance is greater than or equal to a predetermined value, determining that moisture is in the ear jack (301, 401, 501, 601, 701, 801); or if the third impedance value is less than the predetermined value, determining that an earplug is in the ear jack (301, 401, 501, 601, 701, 801); and wherein the first terminal is a left terminal (302, 402, 502, 602, 702, 802), and the second terminal is a ground terminal (304, 404, 504, 604, 704, 804).