| search() | ใช้ค้นหาข้อมูลใน stack หากพบข้อมูลจะคืนค่าตำแหน่งที่พบกลับมา หากไม่พบข้อมูลจะคืนค่า -1 กลับมา |
|---|
method:search ( object );
return type:int
content:ใช้ค้นหาข้อมูลใน stack หากพบข้อมูลจะคืนค่าตำแหน่งที่พบกลับมา หากไม่พบข้อมูลจะคืนค่า -1 กลับมา
example:Stack stack = new Stack(); stack.push ( "data one" ); stack.push ( new int ( 15 ) ); int position = stack.search ( new int ( 15 ) );