Before getting into an example, we should know what is toast in android. Toast is subclass for java.lang.Object and used to show a short message for a short period of time after that is going to disappear.This example demonstrates how to change the position of Toast in Android.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 a text view. when the user clicks on text ... Read More
An adjective clause is a clause which performs the function of an adjective in a sentence. The adjective is a word which modifies a noun or pronoun in a sentence. For example, a tall man, (where tall is an adjective) etc.The adjective clause may be introduced by a relative pronoun (whom, which, that, who etc) or relative adverb (where, when, after, before etc).Examples of the Adjective ClauseRam, who is the monitor of our class, is intelligent.She is the neighbor, whose dog is Ill-behaved.Give me a reason why should I believe you.Here, 'who is the monitor of the class' in the ... Read More
Here are some of the latest Apple products unveiled at Worldwide Developers Conference (WWDC) in June 2017.iMac ProApple introduced a brand new model for existing iMac which is focused on offering strong performances.All new iMac pro comes out with a 27-inch screen with 5K display and space gray finish.Now, the iMac will feature Intel Xenon processors with 8, 10 and 18 core options. It also comes with 128GB memory and one TB of storage space. It has 3 USB-c ports and includes new Radeon Vega graphics. It will be priced around 5000USD.iMacApple also announces upgrades for existing iMac systems. All ... Read More
Let us first create a NavigableMapNavigableMap n = new TreeMap();Now, let us add some elementsn.put("A", 888); n.put("B", 999); n.put("C", 444); n.put("D", 555); n.put("E", 666); n.put("F", 888);The following is the complete example to create NavigableMap, add elements and display themExample Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put("A", 888); n.put("B", 999); n.put("C", 444); ... Read More
You can search for a string within text column in MySQL with the help of LIKE clause. The syntax is as follows −select *from yourTableName where yourColumnName like '%anyStringValue%';To use the above syntax, let us first create a table −mysql> create table SearchTextDemo −> ( −> BookName TEXT −> ); Query OK, 0 rows affected (0.55 sec)Insert some strings in the table. The query is as follows −mysql> insert into SearchTextDemo values('Let us C'); Query OK, 1 row affected (0.28 sec) mysql> insert into SearchTextDemo values('C in Depth'); Query OK, 1 row affected (0.14 sec) ... Read More
Yagi-Uda antenna is the most commonly used type of antenna for TV reception over the last few decades. It is the most popular and easy-to-use type of antenna with better performance, which is famous for its high gain and directivity. The frequency range in which the Yagi-Uda antennas operate is around 30 MHz to 3 GHz which belong to the VHF and UHF bands.Construction of Yagi-Uda AntennaA Yagi-Uda antenna was seen on top of almost every house during the 90's when we had only Doordarshan Channels. The parasitic elements and the dipole together form this Yagi-Uda antenna. It is seen ... Read More
You can change the column position of MySQL table without losing data with the help of ALTER TABLE command. The syntax is as follows −ALTER TABLE yourTableName MODIFY yourColumnName1 data type AFTER yourColumnName2;To understand the above concept, let us create a table. The query to create a table with some columns is as follows −mysql> create table changeColumnPositionDemo −> ( −> StudentId int, −> StudentAddress varchar(200), −> StudentAge int, −> StudentName varchar(200) −> ); Query OK, 0 rows affected (0.72 sec)Let us insert some data in the table. The query to insert records is as follows -.mysql> insert into changeColumnPositionDemo ... Read More
Use the clone() method to copy all elements from one set to another.First HashSet −HashSet set = new HashSet (); set.add("One"); set.add("Two");Create another set and clone first set into the second −HashSet newSet = new HashSet ();Copy (clone) all elements to the second set −newSet = (HashSet)set.clone();The following is an example to copy all elements from one set to another −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { HashSet set = new HashSet (); HashSet newSet = new HashSet (); set.add("One"); ... Read More
To get the maximum element of HashSet, use the Collections.max() method.Declare the HashSet −Set hs = new HashSet();Now let us add the elements −hs.add(29); hs.add(879); hs.add(88); hs.add(788); hs.add(456);Let us now get the maximum element −Object obj = Collections.max(hs);The following is an example to find maximum element of HashSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // create hash set Set hs = new HashSet(); hs.add(29); hs.add(879); ... Read More
To know the biggest value from two or more fields, use the function GREATEST() from MySQL.The syntax is as follows −SELECT GREATEST(MAX(yourColumnName1), MAX(yourColumnName2), ...............MAX(yourColumnName2) ) from yourTableName;Let us understand the above concept by creating a table with more than two columns −mysql> create table GreatestOfTwoOrMore -> ( -> Marks1 int, -> Marks2 int, -> Marks3 int -> ); Query OK, 0 rows affected (0.57 sec)Here is the query to insert records in a table −mysql> insert into GreatestOfTwoOrMore values(23, 78, 89); Query OK, 1 row ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP