Set Bottom Tooltip with CSS

seetha
Updated on 23-Jun-2020 15:21:49

777 Views

To set bottom tooltip, use the top CSS property.You can try to run the following code to set bottom tooltip to a text:ExampleLive demo           .mytooltip .mytext {          visibility: hidden;          width: 140px;          background-color: orange;          color: white;          z-index: 1;          top: 100%;          left: 60%;          margin-left: -90px;          text-align: center;          border-radius: 6px;          padding: 5px 0;          position: absolute;       }       .mytooltip {          position: relative;          display: inline-block;          margin-top: 50px;       }       .mytooltip:hover .mytext {          visibility: visible;       }               Keep mouse cursor over me           My Tooltip text          

Check String as Palindrome in Java

Arjun Thakur
Updated on 23-Jun-2020 15:21:47

4K+ Views

A string is Palindrome if position of each character remain same in case even string is reversed.For example 'MADAM' is a palidrome string as position of each character remain same even if string 'MADAM' is reversed.Now in order to identify a string as palindrome or not we can use library method approach and also without library method approach.But if we want to check if "Madam" is palindrome or not , it will show us that it is not a palindrome because of the upper case of first letter.Example - Without library method. Live Demopublic class Palindrome {    public static void ... Read More

Select Elements with Specified Attribute Starting with Value in CSS

Nitya Raut
Updated on 23-Jun-2020 15:20:41

160 Views

Use the [attribute| = ”value”] selector to select elements with the specified attribute starting with a specified value.You can try to run the following code to implement CSS [attribute| = ”value”] Selector,ExampleLive Demo                    [alt |= Tutor] {             border: 5px solid orange;             border-radius: 5px;          }                              

Instance Variable as Final in Java

Arjun Thakur
Updated on 23-Jun-2020 15:20:34

2K+ Views

final is a non-access modifier for Java elements. The final modifier is used for finalizing the implementations of classes, methods, and variables. A final instance variable can be explicitly initialized only once.A final instance variable should be initialized at one of the following occasions −At time of declaration.In constructor.In instance block.Compiler will throw error, it a final variable is not initialized at all using any of the above methods. Following examples showcases example of instance variables as final.Example Live Demopublic class Tester{    final int A = 1;    final int B;{       B = 2;    }   ... Read More

Instanceof Operator vs IsInstance Method in Java

Chandu yadav
Updated on 23-Jun-2020 15:18:19

448 Views

isInstance method is equivalent to instanceof operator. The method is used in case of objects are created at runtime using reflection. General practice says if type is to be checked at runtime then use isInstance method otherwise instanceof operator can be used. See the example below −Example Live Demopublic class Tester{    public static void main(String[] args) throws ClassNotFoundException {       Integer i = new Integer(10);       System.out.println(usingInstanceOf(i));       System.out.println(usingIsInstance(i));    }    public static String usingInstanceOf(Object i){       if(i instanceof String){          return "String";       } ... Read More

Iterator in Java

Ankith Reddy
Updated on 23-Jun-2020 15:13:29

529 Views

Often, you will want to cycle through the elements in a collection. For example, you might want to display each element. The easiest way to do this is to employ an iterator, which is an object that implements either the Iterator or the ListIterator interface.Iterator enables you to cycle through a collection, obtaining or removing elements. ListIterator extends Iterator to allow bidirectional traversal of a list, and the modification of elements.Before you can access a collection through an iterator, you must obtain one. Each of the collection classes provides an iterator( ) method that returns an iterator to the start ... Read More

Iterator vs ForEach in Java

Arjun Thakur
Updated on 23-Jun-2020 15:12:22

3K+ Views

Collections can be iterated easily using two approaches.Using for-Each loop − Use a foreach loop and access the array using object.Using Iterator − Use a foreach loop and access the array using object.DifferencesConcurrentModificationException − Using for-Each loop, if an object is modified, then ConcurrentModificationException can occur. Using iterator, this problem is elliminated.Size Check − Using for-Each, size check is not required. Using iterator if hasNext() is not used properly, NoSuchElementException can occur.Performance − Performance is similar for both cases.Following is an example of using above ways.Example Live Demoimport java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Tester {    public ... Read More

Create a Responsive Image Gallery with CSS

Arjun Thakur
Updated on 23-Jun-2020 15:10:00

468 Views

To create a responsive image gallery with CSS, you can try to run the following codeExampleLive Demo                    div.myGallery {             border: 2px solid orange;          }          div.myGallery:hover {             border: 1px solid blue;          }          div.myGallery img {             width: 100%;             height: auto;          }          div.desc {             padding: 20px;             text-align: center;          }          .responsive {             padding: 0 5px;             float: left;             width: 24.99999%;          }          @media only screen and (max-width: 700px) {             .responsive {                width: 49.99999%;                margin: 5px 0;             }          }          @media only screen and (max-width: 500px) {             .responsive {                width: 100%;             }          }          .clearfix:after {             content: "";             display: table;             clear: both;          }                                                                                   3D Animation Tutorial>                                                                                     Swift Video Tutorial                                                                                     CSS Tutorial                          

Use Break Statement in While Loop in C#

karthikeya Boyini
Updated on 23-Jun-2020 15:08:57

254 Views

The break statement terminates the loop and transfers execution to the statement immediately following the loop.When the break statement is encountered inside a loop, the loop is immediately terminated and program control resumes at the next statement following the loop.Let us see an example to learn how to work with break statement in while loop. The following code snippet terminates the loop using break statement.if (a > 15) {    break; }The following is the complete code.Example Live Demousing System; namespace Demo {    class Program {       static void Main(string[] args) {          /* local ... Read More

Extension Methods in C#

Samual Sam
Updated on 23-Jun-2020 15:07:24

863 Views

Extension methods are static methods, which are called as if they were instance methods on the extended type. With Extension methods, you can add methods to existing types without even creating a new derived type, recompiling, or modifying the original type.The following is the extension method we have created.public static int myExtensionMethod(this string str) {    return Int32.Parse(str); }Let us see an example wherein we have used extension method.Example Live Demousing System; using System.Text; namespace Program {    public static class Demo {       public static int myExtensionMethod(this string str) {          return Int32.Parse(str);     ... Read More

Advertisements