- 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
Mahesh Parahar has Published 255 Articles
Mahesh Parahar
660 Views
SolutionWe can clear a list easily using its clear() method.Syntaxvoid clear()Removes all the elements of the list.ThrowsUnsupportedOperationException − If the clear operation is not supported by this listExampleThe following example shows how to clear elements from the list using the clear() method.package com.tutorialspoint; import java.util.ArrayList; import java.util.List; public class ... Read More
Mahesh Parahar
632 Views
SolutionWe can add element to an array list easily using its add() method.Syntaxboolean add(E e)Appends the specified element to the end of this list.Type ParameterE − The runtime type of the element to be added.Parameterse − Element to be appended to this listReturnsIt returns true.ThrowsUnsupportedOperationException − If the add operation ... Read More
Mahesh Parahar
1K+ Views
Adobe Photoshop is the most popular photo editor and designing software. Adobe Photoshop is available for Windows, macOS and iPAD. Adobe Photoshop is very easy to use and provides many useful features required for image editing and designing. Adobe Photoshop is an industry standard in photo editing and digital art. ... Read More
Mahesh Parahar
584 Views
:focus:focus selector is used to applying a required style when a form element got to focus like button, link, input box. An element can get focus using mouse or using tab key. A focus remains on the element until another element gets focus.:active:active selector is used to indicating that an ... Read More
Mahesh Parahar
14K+ Views
Hash set and tree set both belong to the collection framework. HashSet is the implementation of the Set interface whereas Tree set implements sorted set. Tree set is backed by TreeMap while HashSet is backed by a hashmap.Sr. No.KeyHash SetTree Set1Implementation Hash set is implemented using HashTable The tree set is implemented ... Read More
Mahesh Parahar
3K+ Views
Comparable and comparator both are an interface that can be used to sort the elements of the collection. Comparator interface belongs to java.util package while comparable belongs to java.lang package. Comparator interface sort collection using two objects provided to it, whereas comparable interface compares" this" refers to the one objects ... Read More
Mahesh Parahar
140 Views
Problem StatementWith a given binary tree, write a program to find the difference between sum of nodes at odd position and even position. Assume root at level 0, odd position, left/right child of root at level 2, left child at odd position and right child at even position and so ... Read More
Mahesh Parahar
314 Views
Problem StatementWith a given binary tree, write a program to find the difference between sum of nodes at odd level and even level. Assume root at level 1, left/right child of root at level 2 and so on.Example 5 / \ ... Read More
Mahesh Parahar
384 Views
Problem StatementWith a given long integer n, write a program to find the difference between sum of the odd digits and even digits to be 0 or not. Index starts from 0.Examplen = 1212112 Sum of odd position elements = 2 + 2 + 1 = 5 Sum of ... Read More
To Continue Learning Please Login
Login with Google