Java Interview Questions

What is Spring? What are the features in Spring Framework?

-->

What is Spring? Spring is a Java based open source framework. It is light weight, loosely coupled, aspect oriented framework. We can develop standalone applications, web applications, distributed applications and enterprise applications & etc using spring framework. What are the features in Spring Framework? 1. Supports POJO and POJI 2. Light weight 3. Builtin middleware…

Write the program to reverse a string with maintaining special character position?

-->

Reverse a string with maintaining special character position. Algorithm : Let input string be ‘inputArray[]’ and length of string be ‘length’ left = 0, right = length-1 While left is smaller than right, do following If inputArray[left] is not an alphabetic character, do left++ Else If inputArray[right] is not an alphabetic character, do right– Else…

What are the scopes of spring bean?

-->

In Spring, bean scope is used to decide which type of bean instance should be return from Spring container back to the caller. Singleton [Default] Only one instance of bean per spring IOC container Prototype A new instance every time bean is requested Request [Web Application Related] Single bean instance per HTTP request Essentially these…

What are the new features are added in spring latest version?

-->

1. Spring 3.2 features Spring MVC Test Framework Asynchronous MVC processing on Servlet 3.0 custom @Bean definition annotations in @Configuration classes @Autowired and @Value to be used as meta-annotations Concurrency refinements across the framework loading WebApplicationContexts in the TestContext framework JCache 0.5 (JSR-107) 2. Spring 4.0 features Removed Deprecated Packages and Methods Java 8 Support Java EE…

Java 2018 Latest Interview questions

Java Interview Questions – 2018

-->

What’s the difference between class diagram and sequence diagram? How many types of design patterns are available? What’s the use UML diagram? How to create singleton design Pattern? Which tool is used to create UML diagram? What’s Immutable object? How to create custom Immutable class? What’s the difference between String and StringBuffer? What’s the difference…

Java 2018 Latest Interview questions

Recent Java Interview Questions – 2018

-->

What’s encapsulation and example and advantages? What’s Abstraction? Explain interface and polymorphism? Explain Serialization and write the program? What’s marker interface? How to clone the object? Draw exception hierarchy? Explain synchronized block and method? Can we override main method? If we override which method will be invoked by jvm? Write the program to sort the…

UML(Unified Modeling Language) Tutorial

-->

1. Explain Deployement Diagram? Used for describing the hardware components where software components are deployed Component diagrams are used to describe the components and deployement diagram shows how they are deployed in hardware Deployement diagrams consist of nodes Nodes are nothing but physical hardwares used to deploy the application Describe the physical components and their…

Java 2018 Latest Interview questions

How garbage collection works internally in Java?

-->

All Java objects are always created on heap in java. What is GC (Garbage collection) process in java? GC (Garbage collection) is the process by which JVM cleans objects(unused objects) from heap to reclaim heap space in java. What is Automatic GarbageCollection in JVM heap memory in java?  Automatic garbage collection is the process of Identifying objectswhich are in use in java heap memoryand which objects…

Java 2018 Latest Interview questions

Object Oriented Design Principles in Java

-->

DRY (Don’t repeat yourself) – avoids duplication in code Don’t write duplicate code, instead use Abstraction to abstract common things in one place. If you have block of code in more than two place consider making it a separate method, or if you use a hard-coded value more than one time make them public final constant. Benefit…