JAVA

Calling C/C++ function from JAVA

C/C++ and Java are popular programming languages. The Java Native Interface (JNI) is a standard to integrate in a portable way C++ and Java code. JNI works both way i.e. C++ implementation can be called from JAVA and vice versa. This post discussed about calling C/C++ implementation from JAVA. native [...]

2022-02-03T19:47:41+05:30Categories: Programming|Tags: , |

Shift Operators | Java

Shift Operators are used to shift the bits of a number left or right thereby multiplying or dividing the number by two respectively. Left shift operator (<<) :  Shifts the bits of the number to the left and fills 0 (zero) on left as a result. Signed Right shift operator [...]

2019-12-21T13:26:45+05:30Categories: Programming|Tags: |

Exception Handling | Java

Introduction Exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow of the program’s instructions. Exception indicates conditions that a reasonable application might try to handle gracefully. An Error indicates serious problem that a reasonable application [...]

2019-11-26T21:37:56+05:30Categories: Programming|Tags: |

Iterator Interface | Java

Java Iterator interface used to iterate over the elements in a collection (list, set or map). It helps to retrieve the specified collection elements one by one and perform operations over each element. Iterator Methods boolean hasNext():Returns true if the iteration has more elements. E next(): Returns the next element in [...]

2019-08-15T12:17:48+05:30Categories: Programming|Tags: |

LinkedHashMap | Java

LinkedHashMap is used to store key-value pairs very similar to HashMap class. LinkedHashMap is a hash table and doubly linked List based implementation of Map interface, it extends the HashMap class. The iteration order in a LinkedHashMap is normally the order in which the elements are inserted. However, it also [...]

2019-08-14T23:31:55+05:30Categories: Programming|Tags: |

ListIterator | Java

Like Iterator, ListIterator is a Java Iterator, which is used to iterate elements one-by-one from a List implemented object. Important details about ListIterator It extends Iterator interface. It is useful only for List implemented classes. Unlike Iterator, It supports all four operations: CRUD (CREATE, READ, UPDATE and DELETE). Unlike Iterator, [...]

2019-08-14T23:09:05+05:30Categories: Programming|Tags: |

Try with Resources | Java

Java provides a feature to make the code more robust and to cut down the lines of code. This feature is known as Automatic Resource Management(ARM) using try-with-resources from Java 7 onwards. This approach used to cause memory leaks and performance hit when we forgot to close the resource. The [...]

2019-08-12T23:41:34+05:30Categories: Programming|Tags: |

BufferedReader Class | Java

BufferedReader is a class which simplifies reading text from a character input stream. It buffers the characters in order to enable efficient reading of text data. BufferedReader comes in handy if we want to read text from any kind of input source whether that be files, sockets, or something else. [...]

2019-08-12T21:10:43+05:30Categories: Programming|Tags: |

Scanner Class | Java

Scanner class aims to separate the entry of text into blocks, generating the known tokens, which are sequences of characters separated by delimiters by default corresponding to blanks, tabs, and newline. Like a real scanner, it reads data from a source that you specify (for example, a string, a file, [...]

2019-08-12T20:51:46+05:30Categories: Programming|Tags: |

Stream | Java

Introduction Introduced in Java 8, the Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result. Stream provides following features: It does not store elements. It simply conveys elements from a [...]

2019-08-10T21:50:08+05:30Categories: Programming|Tags: |
Go to Top