- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
2K+ Views
To remove an element from a Queue, use the remove() method.First, set a Queue and insert some elements −Queue q = new LinkedList(); q.offer("abc"); q.offer("def"); q.offer("ghi"); q.offer("jkl"); q.offer("mno"); q.offer("pqr"); q.offer("stu"); q.offer("vwx");Remove the first element −System.out.println("Queue head = " + q.element()); System.out.println("Removing element from queue = " + q.remove());The following is ... Read More
Samual Sam
2K+ Views
To create a Sorted Set, firstly create a Set −Set s = new HashSet();Add elements to the above set −int a[] = {77, 23, 4, 66, 99, 112, 45, 56, 39, 89}; Set s = new HashSet(); try { for(int i = 0; i < 5; i++) { ... Read More
Samual Sam
3K+ Views
The method java.util.Stack.empty() is used to check if a stack is empty or not. This method requires no parameters. It returns true if the stack is empty and false if the stack is not empty.A program that demonstrates this is given as follows −Example Live Demoimport java.util.Stack; public class Demo { ... Read More
Samual Sam
27 Views
The getInt8() function of the DataView gets and returns a signed 8-bit floating point number at the specified position.SyntaxIts syntax is as followsdataView.getInt8();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(20); var dataView = new DataView(arrayBuffer); ... Read More
Samual Sam
31 Views
The getUint16() function of the DataView gets and returns an unsigned 16-bit integer at the specified position.SyntaxIts syntax is as followsdataView.getUint16();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(20); var dataView = new DataView(arrayBuffer); dataView.setUint16(1, ... Read More
Samual Sam
49 Views
Use the containsValue() method to check for the existence of a value. First, create a IdentityHashMap −Map m = new IdentityHashMap();Add some elements −m.put("1", 100); m.put("2", 200); m.put("3", 300); m.put("4", 150); m.put("5", 110); m.put("6", 50); m.put("7", 90); m.put("8", 250); m.put("9", 350); m.put("10", 450);Now check for the existence of a value ... Read More
Samual Sam
38 Views
The getUint8() function of the DataView gets and returns an unsigned 8-bit integer at the specified position.SyntaxIts syntax is as followsdataView.getUint8();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(20); var dataView = new DataView(arrayBuffer); dataView.setUint8(1, ... Read More
Samual Sam
2K+ Views
The location of an element in an ArrayList can be obtained using the method java.util.ArrayList.indexOf(). This method returns the index of the first occurrence of the element that is specified. If the element is not available in the ArrayList, then this method returns -1.A program that demonstrates this is given ... Read More
Samual Sam
25 Views
The setInt32() function of the DataView stores a signed 32-bit integer at the specified position.SyntaxIts syntax is as followsdataView.setInt32();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(20); var dataView = new DataView(arrayBuffer); dataView.setInt32(1, 36274722); ... Read More
Samual Sam
42 Views
The setUint16() function of the DataView stores an unsigned 16-bit integer at the specified position.SyntaxIts syntax is as followsdataView.setUint16();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(20); var dataView = new DataView(arrayBuffer); dataView.setUint16(1, 45544); ... Read More