‘Work-life balance’! Yes, one of those few phrases that has got weaved up into different strings of myriad hues creating new insights and new worlds of meanings and thought. What comes to an average mind when this phrase ‘work-life balance’ strikes? A weighing balance, isn’t? A weighing scale having worked at one end and life at the other and you got to ensure that you balance them correctly. Who does not want to have a better work-life balance? A wish most of us wish. After all, most of us live at each of the two extremes of this work-life balance ... Read More
In this highly competitive world, increasing population of educated people and explosion of media and communication, selecting a career is like walking on a sharpened sword. This is so true for the IT industry, as statistically, the competition is more in this industry. There are numerous or so shall I say “infinite” scope in this Industry and one must understand each, to select the appropriate stream, as per his/her own competencies. One such scope is the “Solutions expert” or “Microsoft Certified Solutions Expert (MCSE)”.MCSE Certification can be done once you have ample experience of configuring and troubleshooting computer frameworks run ... Read More
God helps those who help themselves. While, it is a moral duty of each and every individual to lend a helping hand to others, there are many instances where we have to help our own selves and these are mostly concerned with our safety and protection. Women today are becoming more and more vulnerable to security issues, which is actually a serious problem in our country.It’s time again that women free themselves from the clutches of bondage and become the harbinger of power (Shakti) who has worshiped a Durga in this country yet women live under constant fear and threat. ... Read More
public interface List extends CollectionThe List interface extends Collection and declares the behavior of a collection that stores a sequence of elements.Elements can be inserted or accessed by their position in the list, using a zero-based index.A list may contain duplicate elements.In addition to the methods defined by Collection, List defines some of its own, which are summarized in the following table.Several of the list methods will throw an UnsupportedOperationException if the collection cannot be modified, and a ClassCastException is generated when one object is incompatible with another.ExampleThe above interface has been implemented in various classes like ArrayList or LinkedList, ... Read More
In today’s digital world, we can access just anything and everything, from our small handy buddy, our mobile smartphone. Our little handy phone has become our calendar, reminder, alarm clock, radio, music player, scheduler, phone book, bookstore, movie theater, gaming arcade, portable drive and many more roles it has adapted. With so many roles to play, it is difficult to decide how to accommodate everything in the limited memory space the smartphones have.With the rise of the usage of the cell phones, the number of apps available in play store is ever increasing. Everyday, thousands of apps make it to ... Read More
A List of elements can be created using multiple ways.Way #1Create a List without specifying the type of elements it can holds. Compiler will throw warning message for it.List list = new ArrayList();Create a List and specify the type of elements it can holds.Way #2List list = new ArrayList();Way #3Create and initialize the list in one line.List list = Arrays.asList(object1, object 2);ExampleFollowing is the example to explain the creation of List objects −package com.tutorialspoint; import java.util.*; public class CollectionsDemo { public static void main(String[] args) { List list = new ArrayList(); list.add("Zara"); ... Read More
We can create a list from a set using its constructor.List list = new ArrayList(set);ExampleFollowing is the example showing the conversion of set to list −package com.tutorialspoint; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class CollectionsDemo { public static void main(String[] args) { Set set = new HashSet(); set.add(1); set.add(2); set.add(3); set.add(4); System.out.println("Set: " + set); List list = new ArrayList(set); System.out.println("List: " + list); } }OutputThis will produce the following result −Set: [1, 2, 3, 4] List: [1, 2, 3, 4]
An element can be copied to another List using streams easily.Use Streams to copy selective elements.List copyOfList = list.stream().filter(i -> i % 2 == 0).collect(Collectors.toList());ExampleFollowing is the example to copy only even numbers from a list −package com.tutorialspoint; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class CollectionsDemo { public static void main(String[] args) { List list = Arrays.asList(11, 22, 3, 48, 57); System.out.println("Source: " + list); List evenNumberList = list.stream().filter(i -> i % 2 == 0).collect(Collectors.toList()); System.out.println("Even numbers in the list: " + evenNumberList); ... Read More
Elements can be checked from a list using indexOf() or contains() methods.Syntax - indexOf() methodint indexOf(Object o)Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.Parameterso − Element to search for.ReturnsThe index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.ThrowsClassCastException − If the type of the specified element is incompatible with ... Read More
With all this advancement in technology, we came up across a very interesting concept of video streaming. Now, we all are very much aware of this all thanks to Netflix and other video streaming biggies. Before moving forward let’s first try to understand what happens while streaming a video.What is Video StreamingIn simple words, video streaming is nothing but simply a compressed form of content that is sent over the internet and the viewer can see it in real time. So, no need to wait till the download is finished to watch the video. Since the content is sent in ... Read More