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.
Ans. Java 9 would provide an error at compile time if there are different modules with the same package mapped to the same class loader and hence would provide a compile time check for this issue.
NoClassDefFoundError exists because of ambiguity at realtime because of multiple versions of same package / class exist. As Java 9 would provide a compile time check for it through clearly defined dependencies and exports and a check on duplicate packages being loaded by single class loader, it will fix the problem.
Help us improve. Please let us know the company, where you were asked this question :
Ans. ClassNotFoundException is an exception that occurs when we try to load a class at run time using Class.forName() or loadClass() methods and mentioned classes are not found in the classpath.
NoClassDefFoundError is an error that occurs when a particular class is present at compile time, but was missing at run time.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The problem with serialized singleton class is that whenever we deserialize it, it will create a new instance of the class. To overcome this scenario all we need to do is to provide the implementation of readResolve() method.
Help us improve. Please let us know the company, where you were asked this question :
Ans. In AWS Lambda we can run a function in synchronous or asynchronous mode. In synchronous mode, if AWS Lambda function fails, then it will just give an exception to the calling application. In asynchronous mode, if AWS Lambda function fails then it will retry the same function at least 3 times.If AWS Lambda is running in response to an event in Amazon DynamoDB or Amazon Kinesis, then the event will be retried till the Lambda function succeeds or the data expires. In DynamoDB or Kinesis, AWS maintains data for at least 24 hours.
Help us improve. Please let us know the company, where you were asked this question :
This is the oldest and most popular region. All new features are rolled first in this region and hence they are first available there. The downside is that because of experimentation with new services, unavailability time is quite high.
Help us improve. Please let us know the company, where you were asked this question :
Ans. effect means whether the effect of this Policy is to allow or deny, action means the type of action ( read , write ) and service, and resource is the resource where this should apply.
For example - If we want to have a Policy of providing read access on S3 ,
effect will be "allow"
action will be "s3:GetObject"
resource will be "arn:aws:s3:::examplebucket/*"
Help us improve. Please let us know the company, where you were asked this question :
Ans. Because new files will be fed from where ever they are first available but AWS have no way to identify which is the most updated version among the various regions. The updated version can only be assured once the replication to all availability zones is complete.
Help us improve. Please let us know the company, where you were asked this question :
Q260. Can a EC2 instance have multiple Security Groups ? Can a single security group be assigned to multiple Ec2 instances ? If either of them is true , doesn't it result in conflict ?
Ans. We can assign multiple security groups to single instance and we can use single security group with multiple instances.
It never results in conflict as security groups only have allow rules and no deny rules. Multiple security groups for an instance results in union of all rules.
Help us improve. Please let us know the company, where you were asked this question :
Q264. What is an object's lock and which object's have locks?
Ans. 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.
Help us improve. Please let us know the company, where you were asked this question :
Ans. JSON is "JavaScript Object Notation", primarily used for client-server or server-server communication. Its a much lighter and readable alternative to XML. JSON is language independent and is easily parse-able in all programming languages.
Help us improve. Please let us know the company, where you were asked this question :
Q267. What is an API ( Application Programming Interface ) ?
Ans. An API is a kind of technical contract which defines functionality that two parties must provide: a service provider (often called an implementation) and an application. an API simply defines services that a service provider (i.e., the implementation) makes available to applications.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Tomcat is a web server and a Servlet container. It is often used as an application server for web-based applications but does not include the complete suite of capabilities that a Java EE application server would supply.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  tomcat   j2ee   web server   application server   build management