Posts

Showing posts with the label interview questions and answers

String rotation interview question for 5 Years of exprience

After long time I have got time to update my blog and help to the followers. These are the most commonly asking interview questions in string concept in java. String Rotation: How can you find one string is the rotation of another string? As we all know what the rotation means is, moving the first character of the string into last. When you keep doing the same, after certain moves you will get the initial string. This is what String Rotation is. Let say I have two strings as mentioned in the below, String str1 = “ABCDEF”; String str2 = “DEFABC”; Now, apply your logic to find str1 is the rotation of str2 or in reverse. First try your own, if not follow the below logic. This is also one of the CMMI Level5 company interview question. Steps to solve the above problem: If you want to find str1 is the rotation of str2. Let’s do concatenation of str2 with it. Means String str3 = str2+str2; Find the str3 contains the str1 or not by using the contains () method

JSP interview questions and answers

This page contains the most frequently asking JSP interview questions and answers.This will helps for freshers as well as experienced. 1. What are the advantages of JSP over Servlet?                               OR By using Servlet we can do UI implementation, then why to use JSP in any of the applications? A: JSP is a server side technology to make content generation a simple appear.  The advantages of JSP is that they are document-centric. Servlet on the other hand, look and act like programs. A Java Server Page(JSP) can contain Java program fragments that instantiate and execute java classes, but these occurs inside an HTML template file and are primarily used to generate dynamic content. The power of JSP is that it is server-based and provides a framework for web application development. 2. What is the life cycle of JSP?                        OR Can explain about JSP life cycle? A: When a request is mapped to a JSP page for the first time, It translates the JS

JDBC interview questions and answers

1. What is the JDBC? A. Java Database Connectivity (JDBC) is a standard Java API to interact with relational database form Java. JDBC has set of classes and interfaces which can use from Java application and talk to database without learning RDBMS details and using Database specific JDBC Drivers. 2. What are the new features added to JDBC 4.0? A. The major features added in JDBC 4.0 includes:        • Connection management enhancements        • Support for RowId SQL type        • provides SQL DataSet implementation using annotations        • SQL exception handling enhancements        • SQL XML support 3. Explain basic steps in writing a java program using JDBC? A. JDBC makes the interaction with RDBMS simple and interactive. When a java application needs to access database, Loads RDBMS specific JDBC driver because this driver actually communicates with the database. Opens the connection to database which is then used to send SQL statements and get resul

Polymarphism interview questions and answers in java

Polymorphism is one of the Oops concept and mostly used feature in java. The ability of an object to take more than one form is called Polymorphism. The most common use of polymorphism in OOPs occurs when a parent class reference is used to refer to a child class object.         It is impossible to know that the only possible way to access the object is through a reference variable. A reference variable can be of  only one type. Once declared, the type of the reference variable cannot be changed.         A reference variable can refer to any object of its declared type or any subtype of its declared type. A reference variable can be declared as a class or interface. Ex: Let's take a look into the below example 1 2 3 4 5 interface Vehicle {} class Mileage {} public class Car extends Mileage implements Vehicle {} see the implementation of the above example, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3

Object Oriented Programming in java

Object Oriented Program or Oops is a technique to create programs based on the real world object. In the Oops programming model programs are organized around objects and data rather than actions and logic. What is Oops?           An Object Oriented Programming organizes a program around its data, i.e., objects and a set of well defined interfaces to that data. An object-oriented programming can be characterized as data controlling access to code. Why Oops?           Object Oriented Programming enables programmers define not only the data, but also its associated behaviors that can be applied to the data. It also enables programmers to create relationship between one object and another. For example, Objects can inherit characteristics from other objects. To understand the importance of Oops first we need to understand the problem with Procedural / Structural programming practices. Problems with Procedure Oriented Programming?           Procedure Oriented Programming