Set 2
1. Following snippet of code [crayon-5dd803c4692cb061446382/] 1. raises compilation error 2. compiles but throws exception 3. compiles, executes and prints all the elements 4. last element is not...
View ArticleSet 1
1. compareTo(Object) belongs to which class? 1. Collections 2. Comparator 3. Comparable 4. Arrays 2. singletonList(Object) method is defined in? 1. class ArrayList 2. interface List 3....
View ArticleNew Line BufferedWriter Java
New Line BufferedWriter Java uses newLine() method to give new line in the destination file. Example given. But before going into example and explanation, let us see what DataOutputStream will do with...
View ArticleJava Font Example
Java AWT supports graphics drawing in colors and fonts. To support colors and fonts, the Java.awt package come with two classes – class Color and class Font. Java Font Example to create font objects...
View ArticleInterview Questions for Freshers
OOPS Concepts What are local and global variables? A variable declared inside a method is known as “local variable” and its usage is limited within the method in which it declared only. A global...
View ArticleColor scheme
Collections All Methods – At a Glance Reversing elements with reverse() How many times element occurs with frequency() Replacing elements with replaceAll() Finding Min and Max values with min() and...
View ArticleView All RMI
1. Java RMI Tutorial for Beginners 2. Java RMI Architecture 3. RMI Application Step by Step Programs Explanation 4. RMI Stepwise Compilation Execution Distribution 5. RMI Simple Application with...
View ArticleRMI Simple Application with Database Access
Before this program, it is advised to read the previous simple application InterestCalculation where the basic notes and guidelines are given. This application adds extra features to the previous...
View ArticleRMI Application Step by Step Programs Explanation
RMI Application Coding A typical RMI application includes four programs. Remote interface: Write an interface that should extend an interface called Remote from java.rmi package. Implementation...
View ArticleJava RMI Architecture
The architecture is very simple involving a client program, a server program, a stub and skeleton. In RMI, the client and server do not communicate directly; instead communicates through stub and...
View ArticleRMI Stepwise Compilation Execution Distribution
RMI application involves 4 programs (as illustrated in XXXXXXXXX) and let us see how to execute them to get the desired output step by step. a) Compile all the 4 programs with javac command as usual as...
View ArticleJava RMI Tutorial for Beginners
For easy understanding the concept of RMI, the notes is given in Questions and Answers format as we did in constructors. 1. What is RMI? RMI stands for "Remote Method Invocation". 2. What is remote...
View ArticleRealtime Examples of Multithreading
Generally you will be eating dinner while watching TV. At the same time, you may be talking to your mother to get some more eatables. Now, you are doing three different tasks in parallel. This we call...
View ArticleRemoving Duplicates from Array Java
It is a general and interesting code for beginners and this can be achieved in many ways in Java. This code, I would like to keep as simple as possible using simple Java methods and without using time...
View ArticleRemoving Duplicates from Vector
It is a general and interesting code for beginners and this can be achieved in many ways in Java. This code, I would like to keep the code as simple as possible without using any methods and without...
View ArticleRemoving Duplicates in ArrayList
It is a general and interesting code for beginners and this can be achieved in many ways in Java. This code, I would like to keep the code as simple as possible without using any methods and without...
View ArticleWeakHashMap
WeakHashMap HashMap hm1 = new HashMap(); If hm1 is not used in the remaining part of the code, that is not referenced, the hm1 object is eligibile for garbage collection. That is, as long as hm1 is...
View ArticleWhy Java is both compiled and interpreted language?
In case of C/C++, the source code is directly converted to binary code by the compiler that can be executed by the OS to get output. This binary code generated on one OS does not execute on other OS....
View ArticleWhat is the difference between Encapsulation and Abstraction?
How to explain the difference between Encapsulation and Abstraction before an Interviewer? For a novice, both are very confusing as one depends on the other. Encapsulation is an OOPS concept. As...
View ArticleJava StringBuffer Constructors Example
StringBuffer is mutable and String is immutable. To modify the string present in the buffer, many methods are defined in StringBuffer class. Apart methods, StringBuffer class comes 4 types of...
View Article