Core Java Interview Questions & Answers for Senior Experienced Developer. This is list of some Java fundamental questions and answers, which are commonly asked in a Core Java interview for Experienced Developers. As a senior and matured Java Programmer you must know the answers to these questions to demonstrate basic understanding of Java language and depth of knowledge. The competition for getting a Java job is getting fierce, and its really important that you be well prepared for you dream interview. We highly recommend you to also refer a good java book to get in depth knowledge on each of the below mentioned topic. To get and edge over other Java developers, you may also want to checkout Must Read Core Java Books for Developers. Below is a list of some tricky core java interview questions that may give you an edge in your next Java interview. A Java object is considered immutable when its state cannot change after it is created. Use of immutable objects is widely accepted as a sound strategy for creating simple, reliable code. Immutable objects are particularly useful in concurrent applications. Since they cannot change state, they cannot be corrupted by thread interference or observed in an inconsistent state. Immutable objects simplify your program due to following characteristics : Immutable objects are simple to use test and construct. Immutable objects are automatically thread- safe. Immutable objects do not require a copy constructor. Immutable objects do not require an implementation of clone. Immutable objects allow hash. Code to use lazy initialization, and to cache its return value. Immutable objects do not need to be copied defensively when used as a field. Capital Improvement Program: CIP. Communications Implementation Plan: CIP: Civic Internet Portal: CIP. Common Improvement Program: CIP: COMSEC Interface Processor: CIP: Communication Invoice Process: CIP. Where can I get a Visual Basic interface to zlib? Why does gzip give an error on a file I make with compress/deflate? 51 Responses to “REST APIs must be hypertext-driven. Hypertext does not need to be HTML on a browser. AR Invoice API (Application Program Interface) Posted. The Invoice Creation API is another options for Transaction creation does not mean replacement. I am suspecting, program is also. What does TIP stand for? Technology Investment Program: TIP: TAO Implementation Panel (CLIVAR, GCOS, GOOS) TIP. TACSIM Interface Program: TIP. What does “On-link” mean on the result of “route print” command? So what does 'On-link' mean? Immutable objects are good Map keys and Set elements (Since state of these objects must not change while stored in a collection). Immutable objects have their class invariant established once upon construction, and it never needs to be checked again. Immutable objects always have . You can achieve same functionality by making member as non final but private and not modifying them except in constructor. Concatenation operator . Criteria to choose among String, String. Buffer and String. Builder If the Object value will not change in a scenario use String Class because a String object is immutable. If the Object value can change and will only be modified from a single thread, use a String. Builder because String. Builder is unsynchronized(means faster). What does it all mean? An example of external coupling is a program where one part of the code reads a specific file format that another part of the code wrote. Hash table based implementation of the Map interface. This implementation provides. In the implementation of the conductor program conceived by pianist. C++ Coding Standard Last Modified. Does the programmer really mean assignment here? ![]() If the Object value may change, and can be modified by multiple threads, use a String. Buffer because String. Buffer is thread safe(synchronized). It is very useful to have strings implemented as final or immutable objects. Below are some advantages of String Immutability in Java Immutable objects are thread- safe. Two threads can both work on an immutable object at the same time without any possibility of conflict. Security: the system can pass on sensitive bits of read- only information without worrying that it will be altered You can share duplicates by pointing them to a single instance. You can create substrings without copying. You just create a pointer into an existing base String guaranteed never to change. Immutability is the secret that makes Java substring implementation very fast. Immutable objects are good fit for becoming Hashtable keys. If you change the value of any object that is used as a hash table key without removing it and re- adding it you will lose the object mapping. Since String is immutable, inside each String is a char. Unlike a String. Builder there is no need for padding to allow for growth. If String were not final, you could create a subclass and have two strings that look alike when . There is no such thing as . The difficult thing can be to understand that Java passes . Best approach is to understand the memory needs of your program and ensure it uses memory wisely and does not have leaks. You can use a Java memory profiler to determine what methods in your program are allocating large number of objects and then determine if there is a way to make sure they are no longer referenced, or to not allocate them in the first place. Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. Finally block is NOT called in following conditions If the JVM exits while the try or catch code is being executed, then the finally block may not execute. This may happen due to System. If a exception is thrown in finally block and not handled then remaining code in finally block may not be executed. From the Java. Doc of java. Date: A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value. A milliseconds value represents the number of milliseconds that have passed since January 1, 1. GMT. It provides a way to associate metadata with a class where the language does not have explicit support for such metadata. Whereas a typical interface specifies methods that an implementing class must support, a marker interface does not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. Java utilizes this pattern very well and the example interfaces are java. Serializable - Serializability of a class is enabled by the class implementing the java. Serializable interface. The Java Classes that do not implement Serializable interface will not be able to serialize or deserializ their state. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable. Remote - The Remote interface serves to identify interfaces whose methods may be invoked from a non- local virtual machine. Any object that is a remote object must directly or indirectly implement this interface. Only those methods specified in a . Invoking Object's clone method on an instance that does not implement the Cloneable interface results in the exception Clone. Not. Supported. Exception being thrown. This interface has no methods. So this keyword in combination with Marker interface can be used to take different actions based on type of interface an object implements. Public - main method is called by JVM to run the method which is outside the scope of project therefore the access specifier has to be public to permit call from anywhere outside the application static - When the JVM makes are call to the main method there is not object existing for the class being called therefore it has to have static method to allow invocation from class. Can you think of a questions which is not part of this post? Please don't forget to share it with me in comments section & I will try to include it in the list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |