Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
Check if a large number is divisible by 11 or not in java
A number is divisible by 11 if the difference between the sum of its alternative digits is divisible by 11.i.e. if (sum of odd digits) – ( sum of even digits) is 0 or divisible by 11 then the given number is divisible by 11.Programimport java.util.Scanner; public class DivisibleBy11 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter a number :"); String num = sc.nextLine(); int digitSumEve = 0; int digitSumOdd = 0; for(int i = 0; i
Read MoreDisplay the current method name in Java
The current method name that contains the execution point that is represented by the current stack trace element is provided by the java.lang.StackTraceElement.getMethodName() method.A program that demonstrates this is given as follows −Example Live Demopublic class Demo { public static void main(String args[]) { System.out.println ("The method name is: " + new Exception().getStackTrace()[0].getMethodName()); } }OutputThe method name is: mainNow let us understand the above program.The method getMethodName() is used to obtain the current method name that contains the execution point that is represented by the current stack trace element. This is printed using ...
Read MoreWhat are some amazing facts related to Facebook?
As of the first quarter of 2018, Facebook had 2.19 billion monthly active users. In the third quarter of 2012, the number of active Facebook users had surpassed one billion, making it the first social network ever to do so. Active users are those, which have logged in to Facebook during the last 30 days.The number of mobile Facebook users across the globe in 2018 is 1.34 Billion.Facebook's total quarterly revenue as of the first quarter of 2018 has amounted to 11.96 billion U.S. dollars, the majority of which were generated through advertising.24 Aug 2015, a billion people used Facebook ...
Read MoreHow does the 'off-the-record' chat option of Gmail work? Can these messages be retrieved?
One of the features in Google hangouts ensures that no record of your chat history is stored. To enable this, you simply have to go to −Hangouts> Open any conversation> Go to Setting> check for the option 'Conversation History'> Uncheck the box placed in front of this option>Checked: History is turned on.Unchecked: History is turned off.Now the answer to your another question on retrieving the messages is that 'You, as a user' cannot retrieve; however, your employer, in case you use a shared network, can not only see but retrieve even from 'off' mode. Although, I know that Gmail claims ...
Read MoreLCM of an array of numbers in Java
L.C.M. or Least Common Multiple of two values, is the smallest positive value which the multiple of both values.For example multiples of 3 and 4 are:3 → 3, 6, 9, 12, 15 ...4 → 4, 8, 12, 16, 20 ...The smallest multiple of both is 12, hence the LCM of 3 and 4 is 12.ProgramFollowing example computes the LCM of array of numbers.Live Demopublic class LCMofArrayOfNumbers { public static void main(String args[]) { int[] myArray = {25, 50, 125, 625}; int min, max, x, lcm = 0; for(int i = 0; i
Read MoreWhat is NDPS Act?
The Narcotic Drugs and Psychotropic Substances Act, 1985 is generally referred to as the NDPS Act, which prohibits any individual who is engaged in any activity consisting of producing, cultivating, selling, purchasing, transporting, storing, and/or consuming any narcotic drug or psychotropic substance.When Was It Introduced?The Narcotic Drugs and Psychotropic Substances bill was presented in the Lok Sabha on 23 August 1985 and later, passed by both Lok Sabha and Rajya Sabha. Later on, the then President Giani Zail Singh received this on 16 September 1985 and came into force on 14 Nov 1985.
Read MoreGCD and LCM of two numbers in Java
Following is an example which computes find LCM and GCD of two given numbers.Programimport java.util.Scanner; public class LCM_GCD { public static void lcm(int a, int b){ int max, step, lcm = 0; if(a > b){ max = step = a; } else{ max = step = b; } while(a!= 0) { if(max%a == 0 && max%b == 0) { lcm = max; break; } max += step; } System.out.println("LCM of given numbers is :: "+lcm); } public static void gcd(int a,int b){ int i, hcf = 0; for(i = 1; i
Read MorePerform Animation on CSS border-top-right-radius property
To implement animation on the border-top-right-radius property with CSS, you can try to run the following codeExampleLive Demo table,th,td { border: 2px solid black; } #newTable { width: 500px; height: 300px; background: yellow; border: 15px solid yellow; animation: myanim 3s infinite; background-position: bottom left; background-size: 50px; } @keyframes myanim { 30% { background-color: orange; border-spacing: 50px; border-top-color: red; border-top-right-radius: 150px; } } Performing Animation for border top right radius Subject Student Marks PHP Tom 90 Java Henry 70
Read MoreWhat is the difference between a search engine friendly and search engine optimised website?
This question always muddles the minds of those who want to start a website and get traffic to it as quickly as possible. However, it’s very crucial to know the answer to the question at the early stage, especially during the development because your developer can make your website search engine friendly. However, optimizing a website is a completely different task altogether.Search Engine Friendly Vs Search Engine OptimizedTurning a website search engine friendly is somewhat a one-time process. This process might involve a number of things but once it’s done there is not much required to do unless there is ...
Read MoreJava Program to Match Dates
Firstly, we have considered the following two dates.SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); Date d1 = s.parse("2018-10-15"); Date d2 = s.parse("2018-11-10");Now, use the compareTo() method to compare both the dates. The results are displayed on the basis of the return value.if (d1.compareTo(d2) > 0) { System.out.println("Date1 is after Date2!"); } else if (d1.compareTo(d2) < 0) { System.out.println("Date1 is before Date2!"); } else if (d1.compareTo(d2) == 0) { System.out.println("Date1 is equal to Date2!"); } else { System.out.println("How to get here?"); }Example Live Demoimport java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class ...
Read More