A Java Class Object needs to serialized if we need to store or transfer with the state values. For any IO operations or network operations usually the java class objects needs to sent/received via network via bytes. During serialization, Object along with state is serialized to bytes and can be processed between the systems as … Continue reading “Serialization”
Author: admin
Encryption-Decryption (AES)
Encryption is process of encoding meaningful information using mathematical algorithms using a standard key, so that only authorised parties can only decode/decrypt it. Authorised parties usually shares the secret keys each other so that encrypted information can only be decrypted by them. Plain Text + Key -> Encrypted text Encrypted Text – Key -> Plain … Continue reading “Encryption-Decryption (AES)”
Hashtable
Hashtable is an implementation for storing/processing list of objects using a hashkey and buckets. Hashtable has default load capacity of 11, where it will create default 11 buckets if not provided in specific., and stores the list of objects in the buckets based on the object hashkey. Any object/value inserted into Hashtable object, will be … Continue reading “Hashtable”
java.util.Map
Map is another important key interface in Java present in java.util package. Map contains list of objects associated with a key., for quick retrieval.Each Key is tied to one object i.e., every Object has its own unique key. Since Map stores object values based on keys, it dont maintain any order. Add/Retrieval/Search operations can be … Continue reading “java.util.Map”
java.util.Set
Set is another important Datastructure created in Java, just like List.Set is same as List, except it dont contain duplicates, and dont maintain order. As you remember, List can have duplicates & also maintains internal Order. Set Types: Below are the most used implementation classes of Set Interface. HashSet – HashTable implementation of Set Interface. … Continue reading “java.util.Set”
java.util.List
List is an interface, the most widely used data structure in java, implements the Collections interface. List stores a list of objects, in an inserted order, stores duplicate values. There are different data structure implementations of List interface, like ArrayList class, LinkedList class, Vector class etc., 1. Insert/Delete a Object in a List Methods : … Continue reading “java.util.List”
Threads (Runnable vs Thread)
1.What is Thread? A thread in Java is nothing but an instance of class which is running independently to complete its job.Thread is created in Java with the help of java.lang.Thread class, and hence it is controlled using the same class. Threads executes parallel without waiting for main program/each other and completes its job, unless … Continue reading “Threads (Runnable vs Thread)”
Collections
Collection is the core framework developed in Java using design Patterns.This framework provides the data structure architecture to store, retrieve and process the group of objects/elements. Java Collections has so many interfaces like List, Map, Set, Queue, Vector. List – Ordered collection of Objects, (Maintain Insertion Order) Map – Collection of Key Value Pair Objects, … Continue reading “Collections”
Read/Write File In Java (java.io)
In Java, files can be processed by either streams or buffers. java.io Library – helps in file processing by streams, where this is a classic one.java.nio Library – helps in file processing by buffers, using nio(non blocking IO) is the latest one supported from Java 1.5 Streams are used to process files in Java.io package. … Continue reading “Read/Write File In Java (java.io)”
Streams
1.Overview Streams are introduced in Java in Stream API to handle the operations on the list of elements in functional programming approach. Using Streams we can do multiple operations on the list of elements. We can do filtering(Filter) or ordering (Map) etc., on the list of elements/collections in the stream. Second is we can do … Continue reading “Streams”