More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Q32. Is it advisable to set the member variables through constructors instead of setting them through setters ?
Ans. Yes , If the values to be set are known at the time of initialization and doesn't involve polymorphic behavior.If it's using Dependency Injection , then Constructor injection must be available. If it suffice the above conditions, then definitely its advisable to have them set through constructor as they eagerly load the values into the memory and save it fro multiple values assignment ( one through default constructor and then through assignment )
Help us improve. Please let us know the company, where you were asked this question :
Ans. In Java JVM memory settings is done by use the arguments -Xms -Xmx. Use M or G after the numbers for indicating Megs and Gigs of bytes respectively. -Xms indicates the minimum and -Xmx the maximum.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Asset stores are collections of sharable resources (business artifacts, business processes and storefront assets) that can be leveraged in other stores.
Help us improve. Please let us know the company, where you were asked this question :
Ans. We can copy the elements to a Set and then find the difference of count between ArrayList and Set. As Set don't allow duplicates , they will be removed in the set.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Setter Injection in Spring is a type of dependency injection in which the framework injects the dependent objects into the client using a setter method.
Help us improve. Please let us know the company, where you were asked this question :
Ans. SRF attack requires an authenticated session, whereas an XSS attack doesn’t.
XSS doesn’t require any user interaction.CSRF is restricted to the actions the victim can perform.
XSS requires a vulnerability to happen, whereas CSRF relies on tricking the user to click a link or access a page.
CSRF can only send an HTTP request but cannot view the response. XSS can send and receive HTTP requests and responses to extract the required data.
Help us improve. Please let us know the company, where you were asked this question :