To get the sub set from TreeSet, use the subSet() method. Let us first create a TreeSet and add elements to it −TreeSet set = new TreeSet(); set.add("78"); set.add("56"); set.add("88"); set.add("54"); set.add("76"); set.add("34");Let us get the subset now from a range of elements −SortedSet sorted = set.subSet("54", "76");The following is an example to get sub set from Java TreeSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]){ TreeSet set = new TreeSet(); set.add("78"); set.add("56"); ... Read More
Marketing is a concept which is related to beliefs. With marketing, a consumer is made to believe that a certain product or service delivers the results mentioned. Whether it is digital or traditional, marketing is a tool to sell your product or service by gaining trust. But with the increasing attention towards digital marketing, there are many unethical practices prevailing. Recently, social media platforms like Facebook and YouTube have made their rules more stringent so as to avoid unethical practices in the digital marketing field.What Are They Like?It is unethical to do false marketing by conveying the false messages into ... Read More
This example demonstrates How to Dynamically Add Views into View.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken an empty layout. In this layout, we will have dynamic text view.package com.example.andy.myapplication; import android.graphics.Bitmap; import android.graphics.Matrix; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class MainActivity extends AppCompatActivity { int view = R.layout.activity_main; ... Read More
The extreme elements in a list are the maximum and minimum elements. These can be obtained using the java.util.Collections.max() and java.util.Collections.min() methods respectively.The Collections.max() method contains a single parameter i.e. the list whose maximum element is to be found and it returns the maximum element from the list. The Collections.min() method contains a single parameter i.e. the list whose minimum element is to be found and it returns the minimum element from the list.A program that demonstrates this is given as follows:Exampleimport java.util.Arrays; import java.util.Collections; import java.util.List; public class Demo { public static void main(String args[]) { ... Read More
Satire is a genre of English Literature which is very much confused with irony. It has the target is on the audience in a very indirect manner.Examples of Satire from English Literature:George Orwell's Animal FarmMark Twain's Adventures of Huckleberry FinnAbsolem and Achitophel by John DrydenThe Devil’s Dictionary by Ambrose BierceRestoration Age as the Age of SatireRestoration age was the age of satire with John Dryden, Jonathan Swift as the major political satirists. They pointed out the follies of the then Monarch and that too through their writings. One must not forget “Absalom and Achitophel “ as the gallery of portraits ... Read More
This example demonstrates how to Rotate image in image view by an angle.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken Image view and text view. When a user clicks on Text view, Image will rotate to the 20-degree angle.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.graphics.Bitmap; import android.graphics.Matrix; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; ... Read More
NULL and empty string ‘ ’ both aren’t similar in MySQL. To check the field is empty like ‘ ’or is null, you need to use the IS NULL property or something else. You can check all the conditions with CASE statement. The syntax is as follows:SELECT *, CASE WHEN yourColumnName =’ ‘ THEN ‘yourMessage1’ WHEN yourColumnName IS NULL THEN ‘yourMessage2’ ELSE CONCAT(yourColumnName ,' is a Name') END AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table checkFieldDemo -> ( -> Id int ... Read More
You can create a function using create function command. The syntax is as follows −delimiter // DROP FUNCTION if exists yourFunctionName; CREATE FUNCTION yourFunctionName(Parameter1, ...N) returns type BEGIN # declaring variables; # MySQL statementns END // delimiter ;First, here we will create a table and add some records in the table. After that, a simple function will be created. The following is the query to create a table −mysql> create table ViewDemo −> ( −> Id int, −> Name varchar(200), −> Age int −> ); ... Read More
NOTE: There is only one difference between AND and && is that AND is a standard while && is ownership syntax.Except the above statement, there is no difference between AND and &&. Let us look at all the conditions.The result of AND and && will always be either 1 or 0. As we know the AND and && both are logical operators, if there are more than one operand and any one of them has value 0 then result becomes 0 otherwise 1.Here is the demo of AND and &&.Case 1(a): If both operands are 1. Using AND.The query is ... Read More
The Zilog Z-80 is 40 pin DIP Microprocessor. Here we will see the actual pin level diagram of Z-80 and also the functional pin diagram of it.This is the actual pin diagram of Z-80 Microprocessor. Now we will see the functional pin diagram of it.Now let us see the Pin functions of the Z-80 microprocessor.PinsTypeFunctionA15 – A0Output16-bit address bus, which provides the addresses for memory (up to 64KB)D7 – D0Input/Output8-bit bi-directional data bus to transfer data between memory/IO devices and CPU.BUSACKOutputIt is Bus Acknowledge pin. It indicates the requesting device that the address bus, data bus, control bus enter into ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP