The equivalent of Java long in the context of MySQL variables is BigInt.In Java, the long datatype takes 8 bytes while BigInt also takes the same number of bytes.Demo of Java longHere is the demo of Java long −public class JavaLongDemo { public static void main(String[]args) { long kilometer = 9223372036854775807L; System.out.println("The largest positive value for long range:"+kilometer); } }The following is the output −Demo of BigIntLet us see an example of BigInt type in MySQL. The following is the query to ... Read More
Rat-race junction is a microwave device used when there is a need to combine two signals with no phase difference and to avoid the signals that have a path difference.A normal three port Tee junction is taken and 4th port is added to it, to make this rat-race junction. All of these ports are connected in angular ring forms at equal intervals using series or parallel junctions.The mean circumference of total race be 1.5λ and that each of the four ports is separated by a distance of λ/4. The below figure shows the image of a Rat-race junction.Let us consider ... Read More
First, create a Set and add elements −Set s = new HashSet(); s.add("P"); s.add(new Date()); s.add(new Long(898999)); s.add("Q"); s.add("R"); s.add(new Integer(1));Convert the above Set to a List −List l = new ArrayList(s);The following is an example to convert a set into a list in Java −Example Live Demoimport java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import java.util.HashSet; public class Demo { public static void main(String[] args) { Set s = new HashSet(); s.add("P");; s.add(new Date()); s.add(new Long(898999)); s.add("Q"); s.add("R"); ... Read More
To count how many rows have the same value using the function COUNT(*) and GROUP BY. The syntax is as follows −SELECT yourColumName1, count(*) as anyVariableName from yourTableName GROUP BY yourColumName1;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table RowWithSameValue −> ( −> StudentId int, −> StudentName varchar(100), −> StudentMarks int −> ); Query OK, 0 rows affected (0.55 sec)Insert some records with same value. Here, we have added same marks for more than one student for our example. The query ... Read More
At first, create the first HashSet and add elements to it −// create hash set 1 HashSet hs1 = new HashSet(); hs1.add("G"); hs1.add("H"); hs1.add("I"); hs1.add("J"); hs1.add("K");Create the second HashSet and add elements to it −// create hash set 2 HashSet hs2 = new HashSet(); hs2.add("G"); hs2.add("H"); hs2.add("I"); hs2.add("J"); hs2.add("K");To check whether both the HashSet are equal or not, use the equals() method −hs1.equals(hs2)The following is an example to check whether two HashSet are equal −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // create hash set ... Read More
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