String Object In string object new keyword will be used to create an object, the object will be created in Heap memory and its reference will be pointed to...
Author - Mathan Lal
Serialization Serialization is the process of converting Object state to a byte stream so that the byte stream can be reverted back into a copy of the object...
Copying a file content: FileReader and FileWriter can be combined together to copy a content from one file to another. Example import java.io...
FileWriter Appending : FileWriter has the following constructor to append a content to existing file. Constructs a FileWriter object given a File object. If...
FileWriter FileWriter can be used to write a character file, It can be used to write a char or String in java. Example import java.io.FileWriter; import...
BufferedReader Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. The...
FileReader FileReader class for reading character files, It can read any file char by char. Example import java.io.File; import java.io.FileReader; import java...
Synchronized block example Instead of synchronizing the entire method we can synchronize a small piece of code using block. Example public class Sample...
File An abstract representation of file and directory pathnames, File class help developer to work with files like creating, renaming, deleting etc…...
Synchronization: Synchronization prevents concurrent execution of method or block that depends on same object, Threads communicate primarily by sharing access...
Runnable interface: Creating threads using runnable interface will not block you from using inheritance, Create a class that impliments Runnable interface and...
Thread Using Thread Class Step 1 Create a class that extends thread class and write your functionality in it. public class Sam extends Thread { public void...
Thread: The Java platform is designed from the ground up to support concurrent programming, threads can share the resource and can run concurrently...
User defined exception: Java allows us to write own exception class for our project, we all know that all exceptions are subclasses of Exception. Writing...
Finally block in Java The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected...
Exception in Java: What is exception? An exception is an event, which occurs during the execution of a program, which disrupts the normal flow of the...
Interface Interface provides a standards that to be implemented in a related class. Implementing an interface allows a class to become more formal about the...
Access modifiers: Access level modifiers determine whether other classes can use a particular field or invoke a particular method. Access modifiers (or access...
Packages: A package is a grouping of related types providing access protection and name space management. Note that types refers to classes, interfaces...
Abstract class: Abstract class be used if you want to share code among several closely related classes, the class that has common code can be declared as...