- 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
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
373 Views
First, set the collection −String strArr[] = { "P", "Q", "R", "S" };Now, take a Set and add all the elements of the above collection using asList() method −Set s = new HashSet(Arrays.asList(strArr));The following is an example to add all elements from a collection to the HashSet −Example Live Demoimport java.util.Arrays; ... Read More
karthikeya Boyini
236 Views
Declare a HashSet and add elements −Set hs = new HashSet(); hs.add(15); hs.add(71); hs.add(82); hs.add(89); hs.add(91); hs.add(93); hs.add(97); hs.add(99);To copy all the elements, use the toArray() method −Object[] obArr = hs.toArray();The following is an example to copy all elements to HashSet to an object array −Example Live Demoimport java.util.*; public class ... Read More
karthikeya Boyini
298 Views
Create a HashSet and add elements to it −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79); hs.add(81); hs.add(87);Try the below given code to iterate through the elements −Iterator i = hs.iterator(); while (i.hasNext()) System.out.println(i.next());To iterate through the elements of HashSet, try the following code −Example Live Demoimport java.util.*; public class ... Read More
karthikeya Boyini
197 Views
Declare a HashSet and add elements −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79);Now, iterate over the elements −for (Iterator i = hs.iterator(); i.hasNext();) { Object ele = i.next(); System.out.println(ele); }The following is an example that iterate over the elements of HashSet −Example Live Demoimport java.util.HashSet; import java.util.Iterator; ... Read More
karthikeya Boyini
81 Views
Use the font-size-adjust property to preserve the readability when font fallback occurs. You can try to run the following code to implement the font-size-adjust propertyExampleLive Demo #demo { font-size-adjust: 0.90; } Heading Two With font-size-adjust property: This is demo text. Without font-size-adjust property: This is demo text.
karthikeya Boyini
102 Views
Use the grid-column-gap property to set the size of the gap between grid columns in CSSExampleLive Demo .container { display: grid; grid-auto-rows: 50px; grid-column-gap: 30px; grid-row-gap: 20px; background-color: #2E86C1; padding: 10px; } .container>div { background-color: #F2D7D5; text-align: center; padding:10px 0; font-size: 20px; } .ele3 { grid-column-end: span 2; } 1 2 3 4 5 6
karthikeya Boyini
178 Views
Use the all property to reset all the properties. Set all property to initial, inherit or unset.You can try to run the following code to implement the CSS all propertyExampleLive Demo html { color: blue; } #demo { background-color: yellow; color: red; all: inherit; } CSS all property This is demo text.
karthikeya Boyini
88 Views
To implement animation on the border-bottom-left-radius property with CSS, you can try to run the following codeExampleLive Demo div { width: 500px; height: 400px; ... Read More
karthikeya Boyini
70 Views
Set a linear gradient as the background image, with linear-gradient() CSS function. You can try to run the following code to implement linear-gradient() function in CSSExampleLive Demo #demo { height: 200px; background: linear-gradient(green, orange, maroon); } Setting background as linear gradient.
karthikeya Boyini
2K+ Views
It can be a Cross-Origin Resource Sharing (CORS) issue.video.crossOrigin = 'anonymous';To enable cross-origin resource sharing, use the following. It allows the images to pass the HTTP header with an image response.Access-Control-Allow-Origin: *You can also use the HTML() method −$('#audio').html('');