Correct Answer: Htmlentities() converts all applicable characters to HTML entities While htmlspecialcharacter()converts special characters to HTML entities This means htmlentities( ) will check for non English language characters, such as French accents, the German umlaut, etc
2. What is WATER MARK in oracle? Explain the significance of High water mark.
Correct Answer: WATER MARK is a divided segment of used and free blocks Blocks which are below high WATER MARK ie used blocks, have at least once contained some data This data might have been deleted later Oracle knows that blocks beyond high WATER MARK don?t have data; it only reads blocks up to the high WATER MARK during a full table scan
3. Which containers use a FlowLayout as their default layout ?
Correct Answer: You may be very good at coding,but if you questioning how on earth you could solve this problemThen here is a solution If you remember the good old days of our primary school then the solution is easy,"division is a matter of iterative subtraction" public class TestEvenOdd { public static void main(String arg[ ]){ int num=6; int result=num; while(result>=2){ result=result-2; } if(result==1){ Systemoutprintln("The number is odd"); }else{ Systemoutprint("The number is even"); } } }
Correct Answer: ArrayList and LinkedList both implements List interface and maintains insertion order Both are non synchronized classes But there are many differences between ArrayList and LinkedList classes that are given below ArrayList V/s LinkedList :: 1) ArrayList internally uses dynamic array to store the elements Whereas LinkedList internally uses doubly linked list to store the elements 2) Manipulation with ArrayList is slow because it internally uses array If any element is removed from the array, all the bits are shifted in memory Whereas Manipulation with LinkedList is faster than ArrayList because it uses doubly linked list so no bit shifting is required in memory 3) ArrayList class can act as a list only because it implements List only Whereas LinkedList class can act as a list and queue both because it implements List and Deque interfaces 4) ArrayList is better for storing and accessing data Whereas LinkedList is better for manipulating data
Correct Answer: The Spring IoC is responsible for creating the objects,managing them (with dependency injection (DI)), wiring them together, configuring them, as also managing their complete lifecycle
Correct Answer: There are lots of ways to solve the issue of callback hells: 1 Modularization: break callbacks into independent functions 2 Use a control flow library, like async 3 Use generators with Promises 4 Use async/await (note that it is only available in the latest v7 release and not in the LTS version)
8. What is the difference between ViewState and SessionState?
Correct Answer: 'ViewState' is specific to a page in a session 'SessionState' is specific to user specific data that can be accessed across all pages in the web application
9. What is immutable object? Can you write immutable object ?
Correct Answer: Immutable classes are Java classes whose objects can not be modified once created Any modification in Immutable object result in new object For example is String is immutable in Java Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability You can achieve same functionality by making member as non final but private and not modifying them except in constructor
10. Which of the following are incorrect form of StringBuffer class constructor ?