Question 1. Why Do You Want To Work In This Industry / Company?
First you should try to convince that this company gives huge opportunity in many aspect i.e. new technologies implementation, the policy of company suits you like professionalism. Also you can mention that you are big fan of this company and its your dream company. Basically show your all positive attitude towards company.
Question 2. Which Location Do You Want To Work In And Why?
Give your own choice. Also mention a valid reason for why you are interested for that location. The reason should be always positive and clear. Example :- you can support your family from this location,
Question 3. Describe A Problem You Faced And How You Deal With It ?
You can describe any issue you faced during your project work in the organization. And what the solution you have implemented for that issue.
Question 4. What Are The Types Of Class Loaders In Java?
As per my knowledge there are basically 3 types of class loader like bootstarp classloader,extension class loader and system class loader.
Bootstrap Class Loader
Bootstrap class loader loads java’s core classes like java.lang, java.util etc. These are classes that are part of java runtime environment. Bootstrap class loader is native implementation and so they may differ across different JVMs.
Extensions Class Loader
JAVA_HOME/jre/lib/ext contains jar packages that are extensions of standard core java classes. Extensions class loader loads classes from this ext folder. Using the system environment propery java.ext.dirs you can add ‘ext’ folders and jar files to be loaded using extensions class loader
System Class Loader
Java classes that are available in the java classpath are loaded using System class loader
Question 5. How To Read And Write Image From A File ?
You can use ImageIo.read() and ImageIO.write() method of javax.imageio package.
Question 6. How Concurrenthashmap Works?
The basic design of ConcurrentHashMap is to handling threading. Basically it locks each of the box (by default 16) which can be locked independently and thread safe for operation. And it does not expose the internal lock process.
Question 7. Can A Static Block Throw Exception?
Yes. We can throw checked exception.
Question 8. What Is Difference Between Iterator Access And Index Access?
Basically iterator access process the traverse operation through each element, where index access process access direct the element by using the index.
Question 9. Why Character Array Is Better Than String For Storing Password In Java?
Because, character array stores data in encrypted format which is not readable by human. But,the string stores the data in human readable format which is not secure.
Question 10. What Is Daemon Thread In Java ?
A daemon thread is normally runs on background. And it does not prevent the JVM from exiting when the program finishes but the thread is still running.
Question 11. What Is Java Reflection Api?
Reflection is one of the most powerful api which help to work with classes, methods and variables dynamically. Basically it inspect the class attributes at runtime. Also we can say it provides a metadata about the class.
Question 12. What Is The Difference Between Serializable And Externalizable Interfaces?
Both interfaces are used for implement serialization. But, the basic difference is Serializable interface does not have any method (it’s a marker interface ) and Externalizable interface having 2 methods such as readExternal() and writeExternal(). Serializable interface is the super interface for Externalizable interface.
Question 13. What Is An Abstract Method?
An abstract method is a method whose implementation is deferred to a subclass.
Question 14. What Value Does Read() Return When It Has Reached The End Of A File?
The read() method returns -1 when it has reached the end of a file.
Question 15. Can A Byte Object Be Cast To A Double Value?
No, an object cannot be cast to a primitive value.
Question 16. What Is The Difference Between A Static And A Non-static Inner Class?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
Question 17. What Is An Object’s Lock And Which Object’s Have Locks?
An object’s lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object’s lock. All objects and classes have locks. A class’s lock is acquired on the class’s Class object.
Question 18. What Is The % Operator?
It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand.
Question 19. When Can An Object Reference Be Cast To An Interface Reference?
An object reference be cast to an interface reference when the object implements the referenced interface.
Question 20. Which Class Is Extended By All Other Classes?
The Object class is extended by all other classes.
Question 21. Which Non-unicode Letter Characters May Be Used As The First Character Of An Identifier?
The non-Unicode letter characters $ and _ may appear as the first character of an identifier.
Question 22. What Restrictions Are Placed On Method Overloading?
Two methods may not have the same name and argument list but different return types.
Question 23. What Is Transient Variable?
Transient variable can’t be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can’t be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.
Question 24. What Is Collection Api?
The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces.
Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
Example of interfaces: Collection, Set, List and Map.
Question 25. What Is Casting?
There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.
Question 26. What Is The Return Type Of A Program’s Main() Method?
Question 27. If A Variable Is Declared As Private, Where May The Variable Be Accessed?
A private variable may only be accessed within the class in which it is declared.
Question 28. What Do You Understand By Private, Protected And Public?
These are accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package.
Question 29. What Is Downcasting ?
Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.
Question 30. What Modifiers May Be Used With An Inner Class That Is A Member Of An Outer Class?
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
Question 31. How Many Bits Are Used To Represent Unicode, Ascii, Utf-16, And Utf-8 Characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
Question 32. What Restrictions Are Placed On The Location Of A Package Statement Within A Source Code File?
A package statement must appear as the first line in a source code file (excluding blank lines and comments).