Difference between Java and JavaScript Java - difference between Java and JavaScript - Java is an Object Oriented Programming Language which is developed by Sun Microsystems. It is capable of running on multiple operating systems with the help of..... How to obtain a performance profile of Java program Java - performance profile in Java - To improve the performance of a program, performance analysis is used. The usual purpose of this analysis is to determine which sections of a program to optimize...... Why doesn't Java run on all platforms? Java runs mostly on all platforms. For running a Java program we need JVM on all the platforms. If JVM is not installed on any platform than we are not able to run ... Access native OS calls from a Java program To access native operating system calls from my Java program JNI is used. Java native Interface (JNI) is a programming framework that allows Java code... How do we create and use sockets in Java? A socket is a software endpoint that establishes communication between a server program and one or more client programs... Send data from a Java program to CGI program There are two methods of sending data from Java program to a CGI Program: a.) The first method is that we can use CGI scripting on both client and server by using... Purpose of the executable files Java - purpose of the executable files - java_g is a non-optimized version of java suitable for use with debuggers like jdb. When using java_g to run a program that loads a shared library... URL instance vs. URLConnection instance URLConnection is a class under java.net package. The abstract class URLConnection is the superclass of all classes that represent... How do I read a line of input at a time in Java? The standard input stream is represented by the InputStream object System.in. For reading a whole line at a time BufferedReader is chained to an InputStreamReader... Importance of Thread synchronization for multithreaded programs Threads share the same memory space, i.e., they can share resources. However, there are critical situations where it is desirable that only one thread... How to create a thread and start it running. A thread in Java is represented by an object of the Thread class. Implementing threads is achieved in one of two ways:... When should we use an event adapter class? A listener’s class has to implement Listener interface which means all the methods of the interface must be defined in the class... Component and container classes in Java The Component class is found under java.awt package. The container class is the subclass of Component class... Difference between runtime and plain exception Runtime Exceptions like out-of-bound array indices, NullPointerException , AirthmeticException are all subclasses of java.lang.RuntimeException class... Life cycle for stateless and stateful beans Stateless Session Bean Lifecycle: The stateless session bean does not become passive, so its life cycle has two stages:... Passivation and Activation in EJB Activation is a process of associating an instance with EJB object. Activating a bean is the process of restoring a stateful bean instance’s state relative to its EJB... How do we implement caching in JSP? JSP caching lets you cache tag invocation results within the Java engine. Each can be cached using different cache criteria. JSP caching is defined by following:.. Different Authentication options in Servlets Authentication options available in Servlets: There are four different options for authentication in servlets... How can we use beans in JSP? Java Beans are reusable components. They are used to separate Business Logic from Presentation Logic. Internally a bean is just an instance of a class... Difference between JavaBeans and taglib directives A Java Bean is a reusable software component that can be visually manipulated in builder tools. They can’t manipulate JSP content... Scopes an object can have in a JSP page The scope of JSP objects is divided into four parts. They are: 1. Page: Page scope means the object can be accessed within the page only on which it is created... Use of Externalization interface Externalization is same as serialization. It extends Serializable interface. To externalize your object, you need to implement Externalizable interface that extends ... Widening conversion and Narrowing conversion For a primitive data types, a value narrower data type can be converted to a value of a broader data type without loss of information... How do we implement deep cloning? Deep cloning makes a distinct copy of each of object’s field. By this the two objects are not dependent on each other... Java features Java features - Simple, Object-Oriented, Robust, Distributed, Portable, Interpreted, Multithreaded, Platform Independent, Secure... Java program execution Java program execution - What is JVM? Explain its roles and functions, Why Java is called as Platform independent language. How Java executable executes on any platform where JVM is available... Java architecture Java architecture - Java programming language, Java class file format, Java Application Programming Interface, Java virtual machine... Java class Java class - features of Java class, What are accessors and mutator methods in a Java class?, Explain the importance of 'this' reference. Write a code to depicts the use of 'this' reference... Java constructors Java constructors - What is a constructor? Explain the differences between methods and constructor, Differences between constructors and methods, Write code to depict the use of constructor... Java class member Java class member - What is instance members?, What is instance variable?, What is instance method?, What is static member?, What is static variable?... Java packages Java packages - What are Java packages? Explain the importance of Java packages., Steps for creating a package in Java, Explain the packages access specifier, i.e. private, protected, public, default... Java garbage collector Java garbage collector - Explain Java Garbage collector. Why garbage collection? Brief explanation of Garbage collection algorithms., Explain the importance of finalizers in Java... Java super keyword Importance of 'super' keyword in Java - The keyword ‘super’ is used for referring parent class instance... Java method overloading and overriding Java method overloading and overriding - Define Method overloading, Uses of method overloading, uses of method overriding, Difference between overloading and overriding... Java string class Java string class - Describe Java string class. Explain methods of Java string class. Explain the characteristics of StringBuffer class..... Java inner classes Java inner classes - What is Java inner class? Explain the types of inner classes, i.e. Static member classes, Member classes, Local classes, Anonymous classes, Functionality of wrapper classes. List the primitive types and the corresponding wrapper classes... Java reflection class Java reflection class - Explain about Java reflection class - Classes, interfaces, methods, instance variables can be inspected at runtime by using reflection class... Java swing Java swing - What is Swing? Explain the need of Swing, features of Swing, Java Swing class hierarchy, need of Layout manager... Java layout manager Java layout manager - Different layout manager in Java - Border Layout, Flow Layout, Card Layout, Grid Layout, Grid Bag Layout,... Java exception handling Java exception handling - Explain the need of Exception handling, Exceptions categories, i.e. checked and unchecked exceptions, Provide the general form of Exception handling constructs with explanation, What is user defined Exception?,... Java multithreading Java multithreading - What is Multithreading? Explain the life cycle of a thread, Explain how to use thread class for Multithreading in Java, What are the methods of thread class in java?, Can your explain thread priorities?... Java file handling Java file handling - Use of Streams, Difference between Stream classes and Reader writer classes, Explain and demonstrate the use of File, RandomAccessFile classes, Explain the use of Reader and Writer classes... Java utility classes Java utility classes - What is object Serialization? Explain the use of Persisting object, step of using object Deserialization... Java socket programming Java socket programming - What is socket? Explain the features of socket, characteristics of Java socket class, InetAddress class, DatagramSocket class, DatagramPacket class... JDBC JDBC - Purposes of JDBC API, Describe 4 types of JDBC drivers and their characteristics with usages, State the functionalities of important classes in JDBC packages, Explain how to use JDBC statement to execute SQL queries... Two String objects with same values not to be equal under the == operator. The == operator compares references and not contents. It compares two objects and if they are the same object in memory and present in the same memory location... Static in java Static variables are declared with the static keyword in a class, Static variables are always called by the class name... Garbage collection mechanism in Java The purpose of garbage collection is to identify and remove objects that are no longer needed by a program... Can Abstract Class have constructors? Abstract class can have a constructor. But as we can't instantiate abstract class, we can't access it through the object... How Java addresses the issue of portability and security Addressing Portability: Many computers of different types with several operating systems are connected to network / internet... Different data types for integers and floating-point values - Java The integer and floating-point types are different in terms of the consumption of the bits which represent them... What is endianness? - Java Endianness is the process of ordering the addressable sub units such as words, bytes or bits in a longer word that is to store in an external memory... Why Java uses Unicode? - Java To enable a computer system for storing text and numbers which is understandable by humans, there should be a code that transforms characters into numbers. ... What are the different loops available in java? - Java A loop is a set of statements that is supposed to repeat one or more times. Java supports 3 loops... Primitive type - Java The key word ‘new’ is used for creation of objects. Primitive types are to use constants but not objects. Hence, new key word is not used for primitive variables... What is finalize()? Is finalize() similar to a destructor? - Java The finalize() method of java is invoked by JVM to reclaim the inaccessible memory location, When the ‘orphan’ object (without reference) is to be released, JVM invokes the finalize() method... Why does String define the equals( ) method? - Java The equals() method is defined in String class in order to test whether two strings values are same sequence of characters... String objects are immutable in java A string object that is created using “String” class is immutable. The characters of the object can not be changed / modified. There are some methods, such as split(), substring(), beginsWith() etc...