Top 100+ Play Framework Interview Questions And Answers
Question 1. What Is Play Framework?
Play Framework makes it clean to construct scalable, rapid and real-time internet packages with Java and Scala. In other words Play Framework is a center providing of the Type safe Reactive Paltform. It is a web app framework, written in Scala and Java that provides iterative and Reactive utility improvement quite simple. The Play is a clean opportunity to the legacy Enterprise Java stacks.
Question 2. What Do You Mean By The Java Collection Framework?
Collections are applied in various programming languages and simple launch contained a few classes for collections consisting of Vector, Stack, Hashtable, and Array. But the extra scope and makes use of Java 1.2 got here up with collections Framework the collections interfaces, implementations and unique type algorithms.
Adv Java Interview Questions
Question 3. What Are The Advantages Of Collections Framework?
Some of the advantages of collections framework are:
The reduce development attempt by using middle series training in place of defining series training.
The code best is improved with using completely examined collections framework lessons.
Reduce a few attempt for code renovation by means of using collection lessons with the JDK.
Collection framework additionally gives reusability and Interoperability.
Question four. What Is The Advantage Of Generic In Collection Framework?
The Java 1.5 came with Generic and more collection interfaces and implementations use it broadly speaking. The Generics offer us the form of item that a group can acquire, so if you try and apprehend and add any detail of a different type it throws bring together time errors.
Adv Java Tutorial
Question 5. How Many Basic Interfaces Of Java Collections Framework?
There are 4 principal primary interfaces of Java Collections Framework:
Collection: The series defines is the basis of the gathering hierarchy. A collection provides a collection of various items referred to as its element.
Set: Set is a collection which can't offer reproduction elements. Set interface models the mathematical set abstraction and it's far used for a deck of playing cards.
List: A listing presents ordered and collection can achieve replica factors. So, you may without difficulty find any element from its indexes.
Map: A map can not acquire duplicate keys. Each key can map to at maximum one value.
The a few unique type’s interfaces are:
Core Java Interview Questions
Question 6. What Do You Mean By Iterator In Play Framework?
The iterator interface affords a unique technique to iterate over any Collection. So we are able to without difficulty get iterator example from a set using iterator method. The iterator takes the vicinity of Enumeration inside the Java Collection Framework. The iterator additionally offers the caller to smash factors from the underlying series on the time of the iteration.
Question 7. What Are The Basic Differences Between Enumeration And Iterator Interfaces?
An Enumeration is two times as speedy as Iterator and it's far used for extremely much less reminiscence. Enumeration is also used for is very basic and suits to fundamental needs. But the Iterator is safer compared to Enumeration as it always denies extraordinary threads to adjust the institution item is being iterated by using it. The Iterator affords the caller to wreck factors from the underlying that is not possible with Enumeration.
Core Java Tutorial MySQL Interview Questions
Question 8. What Is The Advantage Of Play Framework?
Here are a number of the most essential benefits:
Java and (Scala)
Amazing blunders dealing with
Graphically improved developer productivity
Question 9. What Do You Mean By Iterator Fail-fast Property?
The Iterator fail-rapid assets test for any change in the structure of the underlying collection every time we attempt to get the subsequent element. If there are any modifications found, through CocurrentModificationException. The complete implementations of Iterator in Collection lessons fail-fast by make except the concurrent collection training including ConcurrentHashMap and CopyOnWriteArrayList.
Java-Springs Interview Questions
Question 10. What Do You Understand By Unsupportedoperationexception?
The UnsupportedOperationException is the exception; it's miles used for indicating that the operation is not supported. It is also used extensively in JDK training, in Collection Framework, java.Util.Collections.UnmodifiableCollection by using this exception for all add or take away operations.
Question 11. What Do Mean By Comparable And Comparator Interfaces?
The Java lets in Comparable interface which always be implemented by using any custom class if we need to use Arrays or Collections sorting techniques. The Comparable interfaces have compared To (T obj) techniques. We always override this technique in any such manner that it returns a terrible integer, zero, or a passive integer if this item is much less than, same to, or larger than the object over as detail.
Android Interview Questions
Question 12. How Can We Design A Synchronized Collection From Giving Collection?
The synchronized collection we` can use collections.SynchronizedCollection (Collection c) to offer a synchronized (thread-secure) collection subsidized through the required collection.
Adv Java Interview Questions
Question thirteen. What Are The Other Methods To Iterate Over A List?
The other techniques iterate over a list in specific approaches:
Using for-every loop
List<String> strList = new ArrayList<>();
//the usage of for-each loop
for(String obj : strList)
//the usage of iterator
Iterator<String> it = strList.Iterator();
String obj = it.Next();
Using iterator is greater thread-safe because it offers positive that if underlying listing factors are changed it will throw ConcurrentModificationException.
Question 14. Why Do You Need To Use A Custom Object As A Key In Collection Classes Such As The Map Or Set?
When are the usage of any custom object in Map as the key, you then want to override equals () or hashCode() approach and comply with their touch. In different phrases, whilst you are storing a custom object in save Collection which includes SortedSet and SortedMap you could additionally use equals() technique is consistent to compareTo () approach, or those collections will not comply with their contacts which include Set might also gives duplicates.
Question 15. What Is The Difference Between Hashmap And Hashtable In Play Framework?
A HashMap isn't always synchronized where as Hashtable is synchronized and HashMap is faster than Hashtable and so forth.
Hibernate Interview Questions
Question 16. Why Do You Use Concurrenthashmap In Java?
If you have equaled the variety of reader and writer than ConcurrentHashMap will carry out in line of Hashtable or synchronized HashMap.
Question 17. What Do You Understand By Hashcode () And Equals () Methods?
A HashMap is used for key object in which as hashCode() and equals() technique to recall the index to out the important thing cost pair. The hashCode () and equals () techniques are also used when we strive to get price from the HashMap. If hashCode() and equals() method isn't outline efficaciously, different key’s may achieve equal hashCode() and equals() result and in that situation rather than storing it at other region, the HashMpa will determine them same and overwrite them. So, we can say that, the collection instructions that does not replica data use hashCode() equals() to decide replica records so those techniques it's miles very necessary to outline correctly.
Java Interview Questions
Question 18. How Can We Use Any Class As Map Key?
If we are able to use any class as Map key, observe these points:
The magnificence usually follows the primary rule optimized with hashCode() and equals() for all times.
If magnificence filed is not used in equals () method, you should not make use of in hashCode() approach.
When the magnificence overrides equals () method, it usually overrides hashCode() method.
Suppose I actually have a category MyFirstKey then I am using a HashMap key.
//MyFirstKey name argument handed is used for equals() and hashCode()
MyFirstKey key = new MyFirstKey('Meraj Ansari'); //count on hashCode=1234
// Below code will trade the important thing hashCode() and equals()
// but its place isn't always changed.
Key.SetName('Deepak Gupta'); //assume new hashCode=98390
myHashMap.Get(new MyFirstKey('Meraj Ansari'));
Core Java Interview Questions
Question 19. What Are The Similarities Between Arraylist And Vector?
There are some ArrayList and Vector are similar instructions in diverse approaches along with:
Maintains the order of insertion and we can provide the elements in the order of insertion.
Iterator defines of ArrayList and Vector altogether is fail-fast by design.
The ArrayList and Vector each provide null values and random access to element utilising index quantity.
Both techniques are listed and based and subsidized up through an array first of all.
Question 20. What Do You Understand By Enumset?
The java.Util.EnumSet is Set define to use with enum sorts. All factors are an Enum set have to come from simplest one Enum kind this is defined, implicitly and explicitly if the set is created. An Enum set isn't always synchronized and null factors aren't furnished. This technique also provides a few beneficial methods including copyOf which means (Collection c) and of(E first, E…relaxation) or complementOf(EnumSet s).
Framework7 Interview Questions
Question 21. What Do Mean By Concurrent Collection Classes?
The Java 1.Five Concurrent package (java.Util.Concurrent) obtains thread secure collection training that offer companies to be modified whilst iterating. Designing by the iterator is fail-speedy and throws ConcurrentModificationException.
The few classes are:
Question 22. What Is Enable Database?
Play Framework lets in in-built guide for H2 database. For permit database, it opens the software.Conf record and a document follows those two rules.
Question 23. How Many Directory For Create A New Directory In Play Framework?
Here are a few directories, creating for the new listing.
App: The directory obtains the utility precise code such as fashions, perspectives and controllers. The version listing will gain the application area version. The views directory gives server aspect templates. And the controller’s package allows the Java code that responds for url routes.
Conf: The conf listing permits application configuration and define the document routes.
Project: The mission listing provides the include scripts. The construct system is primarily based on sbt.
Test: The test listing presents application.