To convert int to current format, use CONCAT() with FORMAT() function from MySQL.The syntax is as follows −SELECT CONCAT(‘CurrencySymbol’, FORMAT(yourColumnName, valueAfterDecimal)) as AnyVariableName from yourTableName;To understand the above syntax, let us create a table. The query to create a table −mysql> create table AddingCurrencySymbolDemo −> ( −> Amount int −> ); Query OK, 0 rows affected (1.50 sec)Insert records in the table using insert command. The query is as follows −mysql> insert into AddingCurrencySymbolDemo values(250); Query OK, 1 row affected (0.22 sec) mysql> insert into AddingCurrencySymbolDemo values(500); Query OK, 1 ... Read More
The advancement of social media has introduced many terms to us. Some of those terms are sharing, blogging and publishing. Let us understand what do they mean.BloggingBlogging is one of them. Blogs are the pages where you can create the content and can share with the world. Writing your content in blogs is called Blogging. This content can be anything like stories, experiences, reviews, opinions, criticisms, explanations, etc. whichever you want to share with the world. The famous blogging site is blogspot.comPublishingPublishing is posting the content on to your blog page. By clicking this Publish, you are finalizing your content ... Read More
Both, Wordsworth and Coleridge were famous poets of their time, but both received praise for their own distinct writing styles.ColeridgeSamuel Taylor Coleridge is a popular name among Romantic poets who were influenced by the French Revolution. He was a leader of the British Romantic movement and was born on October 21, 1772, in Devonshire, England.Features of Coleridge’s PoetryTreatment of the Supernatural: He treats the supernatural in such a manner that it becomes convincing and at the same time, in some sense, a criticism of life.Suspension of Disbelief: The way in which Coleridge has achieved the willing suspension of disbelief has ... Read More
Stop using ‘Amazing’ and end up being considered an amateur! Rather, try these expressions instead and get labelled as seasoned.AdorableAlluringAmbrosialAstonishingAstoundingAwe-InspiringAwesomeBeauteousBeautifulBewitchingBeyond WordsBlue-ribbonBonnyBreathtakingBrilliantCapitalCaptivatingCharmingClassyDarlingDauntingDazzlingDelectableDelicateDeliciousDelightfulDevineElegantEnchantingEnthrallingEnticingEtherealExaltedExcellentExceptionalExhilaratingExquisiteExtraordinaryFabulous (absolutely, dahling!)FantasticFascinatingFearsomeFetchingFirst-classFirst-rateGloriousGorgeousGracefulGrandHeavenlyIdealImpressiveIncomparableInconceivable (for my fellow Princess Bride fans)IncredibleIndescribableIneffableInspiringIrresistibleLovelyLusciousMagneticMagnificentMajesticMarvelousMesmerizingOutstandingProdigiousRadiantRapturousRavishingRefinedResplendentSavoryScrumptiousSensualSexyShockingSpectacularSplendidStaggeringStrikingStunningStupefyingSublimeSuperbSupremeSurprisingTantalizingThrillingTop-notchTranscendentTremendousUnbelievableUnearthlyUnutterableUpliftingWonderfulWondrousYummyAnd, if you totally amazed then this one.... (+_ +)Amazeballs
The first element in the Vector can be obtained using the java.util.Vector.firstElement() method. The last element in the Vector can be obtained using the java.util.Vector.lastElement() method. Neither of these methods requires any parameters.A program that demonstrates this is given as follows:Example Live Demoimport java.util.Vector; public class Demo { public static void main(String args[]) { Vector vec = new Vector(); vec.add(4); vec.add(7); vec.add(2); vec.add(8); ... Read More
The find() method finds the multiple subsequences in an input sequence that matches the pattern required. This method is available in the Matcher class that is available in the java.util.regex packageA program that uses the find() method to find multiple subsequence in Java is given as follows:Example Live Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo { public static void main(String args[]) { Pattern p = Pattern.compile("the"); Matcher m = p.matcher("eclipses of the sun and the moon"); System.out.println("Subsequence: the"); System.out.println("Sequence: eclipses of the sun and the moon"); ... Read More
Shakespeare is one of the greatest of all writers. He is the one who is remembered for only the magnanimity and grandeur of his works. The works of Shakespeare can be divided into three stages - historical, comedies, and tragedies. Out of the tragedies, King Lear is a melancholic tragedy written in 1605.Features of TragedyThe hero has a terrible flaw.The mood of foreboding follows the play.Hero has experiences of providence not favoring him.The end is usually the death of one or more people as a part of the play.If not death, there is a downfall of the hero which may ... Read More
One of the quantifiers is the plus(+). This matches one or more of the subsequence specified with the sequence.A program that demonstrates using the quantifier plus(+) to find a match in Java is given as follows:Example Live Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo { public static void main(String args[]) { Pattern p = Pattern.compile("o+"); Matcher m = p.matcher("o oo ooo"); System.out.println("The input string is: o oo ooo"); System.out.println("The Regex is: o+ "); System.out.println(); while (m.find()) { System.out.println("Match: ... Read More
Create a TreeSet and add elements −TreeSet tSet = new TreeSet(); tSet.add("TV"); tSet.add("Radio"); tSet.add("Internet");Iterate through the elements −Iterator i = tSet.iterator(); while(i.hasNext()){ System.out.println(i.next()); }The following is an example to create a TreeSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]){ TreeSet tSet = new TreeSet(); tSet.add("TV"); tSet.add("Radio"); tSet.add("Internet"); Iterator i = tSet.iterator(); while(i.hasNext()){ System.out.println(i.next()); } } }OutputInternet Radio TV
You can update MySQL with IF condition as well as CASE statement. For this purpose, let us first create a table. The query to create a table −mysql> create table UpdateWithIfCondition −> ( −> BookId int, −> BookName varchar(200) −> ); Query OK, 0 rows affected (0.60 sec)Now you can insert records in the table using insert command. The query is as follows −mysql> insert into UpdateWithIfCondition values(1000, 'C in Depth'); Query OK, 1 row affected (0.12 sec) mysql> insert into UpdateWithIfCondition values(1001, 'Introduction to Java'); Query OK, 1 row affected (0.14 sec)Display all records ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP