S. Nageswara Rao, Corporate Trainer

S. N. Rao has 20+ years hands on experience in Java and J2EE technologies. He has written 20+ books on java for students pursuing graduate and PG studies. Apart writing books, he is busy in taking corporate trainings.

Set 2 – Java, Oracle, Unix Interview Questions

1. Following snippet of code String citiesArray[] = { “Hyderabad”, “Chennai”, “Vizag”, “Delhi” }; List citiesList = Arrays.asList(citiesArray); for(String temp : citiesList) { System.out.println(temp); } 1. raises compilation error 2. compiles but throws exception 3. compiles, executes and prints all the elements 4. last element is not printed 2. Observe, the following snippet of code. …

Set 2 – Java, Oracle, Unix Interview Questions Read More »

Set 1 – Java, Oracle, Unix Interview Questions

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.  interface Collection 4. class Collections 3.   When a thread is started with start() method, in which state it exists? 1.  born state 2.  runnable state 3. …

Set 1 – Java, Oracle, Unix Interview Questions Read More »

Color 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 max() Sorting ArrayList with Collections sort() Sorting ArrayList with Collections sort() Comparator Searching an element with binarySearch() Copying one list to another with copy() Swapping …

Color scheme Read More »

RMI Database Access Simple Application

RMI Database Access Application 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 application like database access, security features and handling exceptions thrown by each method instead of throwing a generic Exception. In this Bank …

RMI Database Access Simple Application Read More »

RMI Application Step by Step Explanation

RMI Application Coding Note: But before going into this tutorial, it is advised to read RMI tutorial and also architecture. A typical RMI application includes four programs. Remote interface: Write an interface that should extend an interface called Remote from java.rmi package. Implementation program: Write a concrete class which extends UnicastRemoteObject and implements the above …

RMI Application Step by Step Explanation Read More »

RMI Execution Compilation Distribution Stepwise

RMI application involves 4 programs (as illustrated in the first simple Interest Calculation application) and let us go for RMI Execution to 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 follows: c\snr> javac Interest*.java This compiles all the …

RMI Execution Compilation Distribution Stepwise Read More »

Removing Duplicates Array Java

Removing Duplicates Array Java Summary: Java is so developed by Designers to write code easily for Developers. Forget the laborious days of C/C++ coding. This tutorial "Removing Duplicates Array Java" is the place to prove it. It is a general and interesting code for beginners and this can be achieved in many ways in Java. …

Removing Duplicates Array Java Read More »

Difference Encapsulation Abstraction

Difference Encapsulation Abstraction Summary: It is very confusing concept, as one depends on other, for a Java beginner to understand. Explained in simple terms in this tutorial "Difference Encapsulation Abstraction". How to explain the difference between Encapsulation and Abstraction before an Interviewer? Encapsulation is an OOPS concept. As everyone says, Encapsulation is binding the data …

Difference Encapsulation Abstraction Read More »

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, there are 4 types of StringBuffer Constructorsas on Java SE 7. public StringBuffer() public StringBuffer(int initialCapacity) public StringBuffer(String str) public StringBuffer(CharSequence seq) Let us see what Java API says about StringBuffer …

StringBuffer Constructors Example Read More »