![]() ![]() To improve application performance, Service Locator caches service objects to eliminate unnecessary JNDI (Java Naming and Directory Interface) activity that occurs in a lookup operation.Īns: Session facade is one design pattern that is often used while developing enterprise applications. The Service Locator hides the lookup process's implementation details and complexity from clients. ![]() e.g.Ans:The Service Locator pattern locates J2EE (Java 2 Platform, Enterprise Edition) services for clients and thus abstracts the complexity of network operation and J2EE service lookup as EJB (Enterprise JavaBean) Interview Questions - Home and JMS (Java Message Service) component factories. We can use the ‘new’ operator to instantiate and initialize it. Q6. What is an Anonymous inner class in Java?Īnonymous inner class is an inner class declared and instantiated at the same time. The name of the constructor is the same as the name of the class. We can have multiple constructors for a single class and at least one of the constructor will invoke while creating a new object. We can create multiple objects with the same class.Ī constructor is a method that executed when an object is created. An object is a specimen of a class which consists of all data types and methods defined in the class. But each JVM can execute the same bytecode compiled on any operating system.Ī class is a template that holds different information like data types and methods used by the objects. for each OS, we have different JVM installed. ![]() Note that JVM is platform dependent, i.e. On any platform, JVM can execute the same bytecode without recompiling. Because Java compiler compiles the java files to bytecode. Platform independence means once we compile the code for a program, we can run it on any operating system.Java is platform independent. Q3. What do you understand by platform independence? Do you think Java is platform independent? So, we can’t say Java as a pure or fully object-oriented programming language. ![]() But in Java, all primitive types like char, byte, boolean, short, int, double etc. Q2. Why Java is not a fully object-oriented programming language?Ī programming language is a fully object-oriented programming language if everything in a program is an object. Java compiler compiles the “.java” files to “.class” that contains the bytecode for JVM. It converts the Java bytecode to machine language. It is called “virtual” because JVM doesn’t physically exist. JVM: JVM is the acronym for Java Virtual Machine. Note that JDK is to develop a Java program and JRE is to run a Java program. It provides a runtime environment used to execute a Java program.JRE includes JVM, libraries and a few other classes that needed to execute a Java program. JRE: JRE is the acronym for Java Runtime Environment. Means, we have different installers for different operating systems.JDK includes different utilities required for Java application development like Java virtual machine, libraries, development tools like javac, documentation, debugger etc. This is the development kit for Java application development and debugging. JDK: JDK is the acronym for Java Development Kit. There is no way of guaranteeing what type of problems you may face in an interview but we hope that this blog post will help you to handle a good number of Java questions : In this tutorial, we are listing mostly asked Java interview questionsand answers. You may face many different problems starting from simple beginner level questions to the core concept of different Java classes. Preparing for a Java interview is not an easy task. In this post, we are covering some of the important Java interview questions for your next interview. Java Interview Questions (This Article).Spring MVC Interview Questions with Answers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |