Bounded types with generics in Java

Samual Sam
Published on 20-Jul-2018 12:10:26
There may be times when you'll want to restrict the kinds of types that are allowed to be passed to a type parameter. For example, a method that operates on numbers might only want to accept instances of Number or its subclasses. This is what bounded type parameters are for.To ... Read More

Blank final in Java

karthikeya Boyini
Published on 20-Jul-2018 12:00:40
In Java, a final variable can a be assigned only once. It can be assigned during declaration or at a later stage. A final variable if not assigned any value is treated as a blank final variable. Following are the rules governing initialization of a blank final variable.A blank instance level ... Read More

Bitwise right shift operator in Java

Samual Sam
Published on 20-Jul-2018 11:50:16
Java supports two types of right shift operators. The >> operator is a signed right shift operator and >>> is an unsigned right shift operator. The left operands value is moved right by the number of bits specified by the right operand.Signed right shift operatorThe signed right shift operator '>>' ... Read More

BigSet class in Java

karthikeya Boyini
Published on 20-Jul-2018 11:43:49
The java.util.BitSet class implements a vector of bits that grows as needed. Following are the important points about BitSet −A BitSet is not safe for multithreaded use without external synchronization.All bits in the set initially have the value false.Passing a null parameter to any of the methods in a BitSet ... Read More

BigInteger class in Java

Samual Sam
Published on 20-Jul-2018 11:32:26
The java.math.BigInteger class provides operations analogs to all of Java's primitive integer operators and for all relevant methods from java.lang.Math.It also provides operations for modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and a few other miscellaneous operations. All operations behave as if BigIntegers were represented in twos-complement ... Read More

Beginning Java programming with Hello World

karthikeya Boyini
Published on 20-Jul-2018 11:12:31
Let us look at a simple code that will print the words Hello World.ExampleLive Demopublic class MyFirstJavaProgram {    /* This is my first java program.        * This will print 'Hello World' as the output        */    public static void main(String []args) ... Read More

Automatic resource management in Java

Samual Sam
Published on 20-Jul-2018 10:58:17
automatic resource management or try-with-resources is a new exception handling mechanism that was introduced in Java 7, which automatically closes the resources used within the try-catch block.ResourceA resource is an object which is required to be closed once our program finishes. For example, a file is read, database connection and ... Read More

Bootstrap .modal("show") method

David Meador
Published on 20-Jul-2018 11:02:12
The modal(“show”) method opens a modal like below −The modal is displayed using the modal(“show”) method as shown below −$("#newModal").modal("show");Let us see an example of modal(“show”) method −ExampleLive Demo<!DOCTYPE html> <html lang="en">   <head>     <title>Bootstrap Example</title>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1">     ... Read More

Remove borders from an element in Bootstrap

Amit Diwan
Published on 20-Jul-2018 10:57:38
Use the border-0 class in Bootstrap 4 to remove all borders from an element in Bootstrap 4 −<div class="mystyle border no-border">   no border </div>Above, we have the div class to no-border class and this allow us to remove the borders from the element.Let us see an example to implement ... Read More

Bootstrap 4 .border-light class

David Meador
Published on 20-Jul-2018 10:55:08
Use the border-light class in Bootstrap 4, to set a light gray border to an element as shown below<div class="demo border border-light">   light border </div>Style for the demo class is for the element −.demo {   width: 150px;   height: 220px;   margin: 15px; }Learn how to work with ... Read More