Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Describe Some Of The Standard Spring Events.

Answer»

Spring provides the FOLLOWING standard events:

ContextRefreshedEvent: This EVENT is published when the ApplicationContext is either initialized or refreshed. This can also be raised using the refresh method on the ConfigurableApplicationContext interface.
ContextStartedEvent: This event is published when the ApplicationContext is started using the start method on the ConfigurableApplicationContext interface. You can poll your database or you can re/start any stopped application after RECEIVING this event.
ContextStoppedEvent: This event is published when the ApplicationContext is stopped using the stop method on the ConfigurableApplicationContext interface. You can do REQUIRED housekeep work after receiving this event.
ContextClosedEvent: This event is published when the ApplicationContext is closed using the close method on the ConfigurableApplicationContext interface. A closed context reaches its end of life; it cannot be refreshed or restarted.
RequestHandledEvent: This is a web-specific event telling all beans that an HTTP request has been SERVICED.

 

Spring provides the following standard events:

ContextRefreshedEvent: This event is published when the ApplicationContext is either initialized or refreshed. This can also be raised using the refresh method on the ConfigurableApplicationContext interface.
ContextStartedEvent: This event is published when the ApplicationContext is started using the start method on the ConfigurableApplicationContext interface. You can poll your database or you can re/start any stopped application after receiving this event.
ContextStoppedEvent: This event is published when the ApplicationContext is stopped using the stop method on the ConfigurableApplicationContext interface. You can do required housekeep work after receiving this event.
ContextClosedEvent: This event is published when the ApplicationContext is closed using the close method on the ConfigurableApplicationContext interface. A closed context reaches its end of life; it cannot be refreshed or restarted.
RequestHandledEvent: This is a web-specific event telling all beans that an HTTP request has been serviced.

 

2.

What Does A Spring Application Look Like?

Answer»

An INTERFACE that defines the FUNCTIONS.
The implementation that contains properties, its setter and GETTER methods, functions etc.,Spring AOP 
The Spring configuration XML file.
Client program that uses the FUNCTION

An interface that defines the functions.
The implementation that contains properties, its setter and getter methods, functions etc.,Spring AOP 
The Spring configuration XML file.
Client program that uses the function

3.

Explain The Spring Mvc Module

Answer»

MVC framework is provided by Spring for building WEB applications. Spring can easily be integrated with other MVC frameworks, but Spring’s MVC framework is a better choice, SINCE it uses IoC to PROVIDE for a clean separation of controller logic from business objects. With Spring MVC you can declaratively BIND request parameters to your business objects.

MVC framework is provided by Spring for building web applications. Spring can easily be integrated with other MVC frameworks, but Spring’s MVC framework is a better choice, since it uses IoC to provide for a clean separation of controller logic from business objects. With Spring MVC you can declaratively bind request parameters to your business objects.

4.

Explain The Web Module

Answer»

The Spring web MODULE is built on the application CONTEXT module, providing a context that is appropriate for web-based applications. This module also contains support for several web-oriented tasks such as transparently handling multipart REQUESTS for file uploads and programmatic BINDING of request parameters to your business objects. It also contains integration support with Jakarta Struts.

The Spring web module is built on the application context module, providing a context that is appropriate for web-based applications. This module also contains support for several web-oriented tasks such as transparently handling multipart requests for file uploads and programmatic binding of request parameters to your business objects. It also contains integration support with Jakarta Struts.

5.

Explain The Object/relational Mapping Integration Module

Answer»

Spring also supports for using of an object/relational MAPPING (ORM) tool over straight JDBC by providing the ORM module. Spring provides support to TIE into several popular ORM FRAMEWORKS, INCLUDING Hibernate, JDO, and IBATIS SQL Maps. Spring’s transaction management supports each of these ORM frameworks as well as JDBC.

Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM module. Spring provides support to tie into several popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps. Spring’s transaction management supports each of these ORM frameworks as well as JDBC.

6.

Explain The Jdbc Abstraction And Dao Module

Answer»

With the JDBC abstraction and DAO module we can be sure that we keep up the database code clean and simple, and PREVENT problems that RESULT from a failure to CLOSE database resources. It provides a layer of meaningful exceptions on top of the error messages given by SEVERAL database servers. It also makes use of Spring’s AOP module to provide transaction management services for objects in a Spring application.

With the JDBC abstraction and DAO module we can be sure that we keep up the database code clean and simple, and prevent problems that result from a failure to close database resources. It provides a layer of meaningful exceptions on top of the error messages given by several database servers. It also makes use of Spring’s AOP module to provide transaction management services for objects in a Spring application.

7.

Explain The Aop Module

Answer»

The AOP module is used for developing aspects for our Spring-enabled APPLICATION. Much of the SUPPORT has been PROVIDED by the AOP Alliance in order to ensure the interoperability between Spring and other AOP FRAMEWORKS. This module also introduces metadata programming to Spring.

The AOP module is used for developing aspects for our Spring-enabled application. Much of the support has been provided by the AOP Alliance in order to ensure the interoperability between Spring and other AOP frameworks. This module also introduces metadata programming to Spring.

8.

Explain Xmlbeanfactory?

Answer»

The most useful ONE is org.springframework.beans.factory.xml.XmlBeanFactory, which loads its beans based on the definitions contained in an XML file. This container READS the configuration metadata from an XML file and uses it to create a FULLY configured system or application.

The most useful one is org.springframework.beans.factory.xml.XmlBeanFactory, which loads its beans based on the definitions contained in an XML file. This container reads the configuration metadata from an XML file and uses it to create a fully configured system or application.

9.

What Is Beanfactory?

Answer»

A BEANFACTORY is an implementation of the factory pattern that applies Inversion of CONTROL to separate the application’s configuration and dependencies from the actual application code.
The most commonly used BeanFactory implementation is the XMLBEANFACTORY CLASS.

A BeanFactory is an implementation of the factory pattern that applies Inversion of Control to separate the application’s configuration and dependencies from the actual application code.
The most commonly used BeanFactory implementation is the XmlBeanFactory class.

10.

Explain The Core Container (application Context) Module?

Answer»

This is the basic Spring module, which PROVIDES the fundamental functionality of the Spring framework. BEANFACTORY is the heart of any spring-based APPLICATION. Spring framework was built on the top of this module, which MAKES the Spring container.

This is the basic Spring module, which provides the fundamental functionality of the Spring framework. BeanFactory is the heart of any spring-based application. Spring framework was built on the top of this module, which makes the Spring container.

11.

Which Are The Spring Framework Modules?

Answer»

The basic MODULES of the SPRING framework are :

  • CORE module
  • Bean module
  • CONTEXT module
  • Expression Language module
  • JDBC module
  • ORM module
  • OXM module
  • Java Messaging SERVICE(JMS) module
  • Transaction module
  • Web module
  • Web-Servlet module
  • Web-Struts module
  • Web-Portlet module

The basic modules of the Spring framework are :

12.

What Are Benefits Of Spring Framework?

Answer»

Lightweight: Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB.
Inversion of control (IOC): Loose coupling is achieved in Spring, with the Inversion of Control technique. The OBJECTS give their dependencies instead of creating or LOOKING for dependent objects.
Aspect oriented (AOP): Spring supports Aspect oriented programming and SEPARATES application business logic from system services.
Container: Spring contains and manages the life cycle and configuration of application objects.
MVC Framework: Spring’s web framework is a well-designed web MVC framework, which provides a great ALTERNATIVE to web frameworks.
Transaction Management: Spring provides a consistent transaction management interface that can scale down to a local transaction and scale up to global transactions (JTA).
Exception Handling: Spring provides a convenient API to translate technology-specific EXCEPTIONS (thrown by JDBC, Hibernate, or JDO) into consistent, unchecked exceptions.

Lightweight: Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB.
Inversion of control (IOC): Loose coupling is achieved in Spring, with the Inversion of Control technique. The objects give their dependencies instead of creating or looking for dependent objects.
Aspect oriented (AOP): Spring supports Aspect oriented programming and separates application business logic from system services.
Container: Spring contains and manages the life cycle and configuration of application objects.
MVC Framework: Spring’s web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks.
Transaction Management: Spring provides a consistent transaction management interface that can scale down to a local transaction and scale up to global transactions (JTA).
Exception Handling: Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO) into consistent, unchecked exceptions.

13.

What Is Class Level Interceptor In Ejb?

Answer»

Class level interceptor is INVOKED for every METHOD of the BEAN. Class level interceptor can be APPLIED both by annotation or via xml(ejb-jar.xml).

Class level interceptor is invoked for every method of the bean. Class level interceptor can be applied both by annotation or via xml(ejb-jar.xml).

14.

What Is Default Interceptor In Ejb?

Answer»

Default INTERCEPTOR is invoked for EVERY bean WITHIN deployment.Default interceptor can be applied only VIA xml (ejb-jar.xml).

Default interceptor is invoked for every bean within deployment.Default interceptor can be applied only via xml (ejb-jar.xml).

15.

What Is Method Level Interceptor In Ejb?

Answer»

METHOD LEVEL interceptor is invoked for a PARTICULAR method of the bean. Method level interceptor can be APPLIED both by annotation of via xml(ejb-jar.xml).

Method level interceptor is invoked for a particular method of the bean. Method level interceptor can be applied both by annotation of via xml(ejb-jar.xml).

16.

Explain @embeddable Annotation.

Answer»

EJB 3.0 provides option to embed JAVA POJO (PLAIN Old Java OBJECT) into an entity bean and allows to map column NAMES with the methods of the embedded POJO CLASS. A java POJO to be embedded must be annotated as @Embeddable.

EJB 3.0 provides option to embed JAVA POJO (Plain Old Java Object) into an entity bean and allows to map column names with the methods of the embedded POJO class. A java POJO to be embedded must be annotated as @Embeddable.

17.

Explain @lob Annotation.

Answer»

EJB 3.0 provides support for Blob and CLOB types using @Lob ANNOTATION.

EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

18.

Which Types Of Java Classes Can Be Mapped Using @lob Annotation?

Answer»

FOLLOWING java TYPES can be mapped USING @LOB annotation:

  • java.sql.Blob
  • java.sql.Clob
  • byte[]
  • String
  • Serializable Object

Following java types can be mapped using @Lob annotation:

19.

What Is A Transaction?

Answer»

A transaction is a SINGLE unit of work ITEMS which FOLLOWS the ACID properties. ACID STANDS for Atomic, CONSISTENT,Isolated and Durable.

A transaction is a single unit of work items which follows the ACID properties. ACID stands for Atomic, Consistent,Isolated and Durable.

20.

What Is Container Managed Transactions?

Answer»

In this TYPE, CONTAINER MANAGES the TRANSACTION STATES.

In this type, container manages the transaction states.

21.

Explain @javax.ejb.local Annotation.

Answer»

@javax.ejb.Local annotation is USED to SPECIFY Local interface(s) of a session bean. This local interface states the business methods of the session bean (which can be stateless or stateful).
This interface is used to expose the business methods to local CLIENTS which are running in same deployment/application as EJB.
Following are its attributes:
VALUE - Used to specify the LIST of local interfaces as an array of interfaces.

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean. This local interface states the business methods of the session bean (which can be stateless or stateful).
This interface is used to expose the business methods to local clients which are running in same deployment/application as EJB.
Following are its attributes:
value - Used to specify the list of local interfaces as an array of interfaces.

22.

Explain @javax.ejb.ejb Annotation.

Answer»

@javax.ejb.EJB annotation is USED to specify or inject a dependency as ejb instance into another ejb. FOLLOWING are its ATTRIBUTES:
name - Used to specify name which will be used to locate the referenced bean in environment.
beanInterface - Used to specify the interface type of the referenced bean.
beanName - Used to PROVIDE name of the referenced bean.
mappedName - Used to specify the JNDI name of the referenced bean.
description - Used to provide description of the referenced bean.

@javax.ejb.EJB annotation is used to specify or inject a dependency as ejb instance into another ejb. Following are its attributes:
name - Used to specify name which will be used to locate the referenced bean in environment.
beanInterface - Used to specify the interface type of the referenced bean.
beanName - Used to provide name of the referenced bean.
mappedName - Used to specify the JNDI name of the referenced bean.
description - Used to provide description of the referenced bean.

23.

Explain @javax.ejb.messagedrivenbean Annotation.

Answer»

@javax.EJB.MessageDrivenBean annotation specifies that a given ejb class is a MESSAGE driven bean. Following are its attributes:
name - Used to specify name of the message driven bean.
messageListenerInterface - Used to specify message listener interface for the message driven bean.
activationConfig - Used to specify the configuration DETAILS of the message-driven bean in operational ENVIRONMENT of the message driven bean.
mappedName - Used to specify the JNDI name of the message driven bean.
description - Used to provide description of the message driven bean.

@javax.ejb.MessageDrivenBean annotation specifies that a given ejb class is a message driven bean. Following are its attributes:
name - Used to specify name of the message driven bean.
messageListenerInterface - Used to specify message listener interface for the message driven bean.
activationConfig - Used to specify the configuration details of the message-driven bean in operational environment of the message driven bean.
mappedName - Used to specify the JNDI name of the message driven bean.
description - Used to provide description of the message driven bean.

24.

Explain @javax.ejb.stateful Annotation.?

Answer»

@javax.ejb.Stateful annotation specifies that a GIVEN ejb class is a stateful SESSION bean.Following are its attributes:
name - USED to specify name of the session bean.
mappedName - Used to specify the JNDI name of the session bean.
description - Used to provide description of the session bean.

@javax.ejb.Stateful annotation specifies that a given ejb class is a stateful session bean.Following are its attributes:
name - Used to specify name of the session bean.
mappedName - Used to specify the JNDI name of the session bean.
description - Used to provide description of the session bean.

25.

Explain @javax.ejb.stateless Annotation.?

Answer»

@javax.ejb.Stateless annotation specifies that a given ejb class is a stateless session bean.Following are its ATTRIBUTES:
NAME - USED to specify name of the session bean.
mappedName - Used to specify the JNDI name of the session bean.
DESCRIPTION - Used to provide description of the session bean.

@javax.ejb.Stateless annotation specifies that a given ejb class is a stateless session bean.Following are its attributes:
name - Used to specify name of the session bean.
mappedName - Used to specify the JNDI name of the session bean.
description - Used to provide description of the session bean.

26.

Is Message Driven Bean A Stateless Bean?

Answer»

Message DRIVEN bean is a stateless bean and is USED to do TASK ASYNCHRONOUSLY.

Message driven bean is a stateless bean and is used to do task asynchronously.

27.

What Are The Key Components Of Persistence Api In Ejb?

Answer»

Following are the key components of PERSISTENCE API in EJB:
Entity - A persistent OBJECT representing the data-store record. It is good to be serializable.
EntityManager - Persistence interface to do data operations like add/delete/update/find on persistent object(entity). It also HELPS to execute queries using Query interface.
Persistence unit (persistence.xml) - Persistence unit DESCRIBES the properties of persistence mechanism.
Data Source (*ds.xml) - Data Source describes the data-store RELATED properties like connection url. user-name,password etc.

Following are the key components of persistence API in EJB:
Entity - A persistent object representing the data-store record. It is good to be serializable.
EntityManager - Persistence interface to do data operations like add/delete/update/find on persistent object(entity). It also helps to execute queries using Query interface.
Persistence unit (persistence.xml) - Persistence unit describes the properties of persistence mechanism.
Data Source (*ds.xml) - Data Source describes the data-store related properties like connection url. user-name,password etc.

28.

What Are The Differences Between Stateful Session Bean And Stateless Session Bean?

Answer»

Following are the differences between stateful session bean and stateless session bean:
EJB Container creates a separate stateful session bean to process client's each request.whereas EJB Container normally creates a pool of few stateless bean's objects and USE these objects to process client's request.
As soon as request scope is over, statelful session bean is destroyed but stateless bean remains active.
A stateful session bean is a TYPE of enterprise bean which preserve the conversational state with client. A stateful session bean as per its name keeps ASSOCIATED client state in its INSTANCE variables Whereas because of pool of stateless session beans, instance VARIABLE values are not guaranteed to be same across lookups/method calls in stateless session beans.

Following are the differences between stateful session bean and stateless session bean:
EJB Container creates a separate stateful session bean to process client's each request.whereas EJB Container normally creates a pool of few stateless bean's objects and use these objects to process client's request.
As soon as request scope is over, statelful session bean is destroyed but stateless bean remains active.
A stateful session bean is a type of enterprise bean which preserve the conversational state with client. A stateful session bean as per its name keeps associated client state in its instance variables Whereas because of pool of stateless session beans, instance variable values are not guaranteed to be same across lookups/method calls in stateless session beans.

29.

What A Remote Session Bean Is Used In Ejb?

Answer»

if EJB CLIENT is in different environment where ejb session bean is to be deployed then we USE remote session bean.

if ejb client is in different environment where ejb session bean is to be deployed then we use remote session bean.

30.

When A Local Session Bean Is Used In Ejb?

Answer»

If EJB client is in same ENVIRONMENT where ejb session BEAN is to be DEPLOYED then we use local session bean.

 

If ejb client is in same environment where ejb session bean is to be deployed then we use local session bean.

 

31.

What Is Message Driven Bean In Ejb?

Answer»

A message driven bean is a TYPE of enterprise bean which is invoked by EJB container when it receives a message from QUEUE or TOPIC. Message driven bean is a STATELESS bean and is USED to do task asynchronously.

 

A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously.

 

32.

What Is Entity Bean In Ejb?

Answer»

ENTITY BEANS represents PERSISTENT data storage. User data can be saved to database VIA entity beans and later on can be retrived from the database in the entity bean.

Entity beans represents persistent data storage. User data can be saved to database via entity beans and later on can be retrived from the database in the entity bean.

33.

What Is Stateless Session Bean In Ejb?

Answer»

A stateless SESSION bean is a type of enterprise bean which is NORMALLY used to do independent operations. A stateless session bean as per its NAME does not have any associated client state, but it may preserve its instance state. EJB Container normally creates a POOL of few stateless bean's objects and use these objects to PROCESS client's request. Because of pool, instance variable values are not guaranteed to be same across lookups/method calls.

A stateless session bean is a type of enterprise bean which is normally used to do independent operations. A stateless session bean as per its name does not have any associated client state, but it may preserve its instance state. EJB Container normally creates a pool of few stateless bean's objects and use these objects to process client's request. Because of pool, instance variable values are not guaranteed to be same across lookups/method calls.

34.

What Is Stateful Session Bean In Ejb?

Answer»

A stateful session bean is a type of enterprise bean which preserve the conversational state with client. A stateful session bean as PER its name keeps associated client state in its INSTANCE variables. EJB Container creates a separate stateful session bean to PROCESS client's each request. As soon as request scope is over, statelful session bean is destroyed.

A stateful session bean is a type of enterprise bean which preserve the conversational state with client. A stateful session bean as per its name keeps associated client state in its instance variables. EJB Container creates a separate stateful session bean to process client's each request. As soon as request scope is over, statelful session bean is destroyed.

35.

What Is A Session Bean In Ejb?

Answer»

Session bean stores data of a particular USER for a SINGLE session. It can be STATEFUL or STATELESS. It is LESS resource intensive as compared to entity beans. Session bean gets destroyed as soon as user session terminates.

Session bean stores data of a particular user for a single session. It can be stateful or stateless. It is less resource intensive as compared to entity beans. Session bean gets destroyed as soon as user session terminates.

36.

What Are The Benefits Of Ejb?

Answer»

FOLLOWING are the key benefits of EJB.

  • Simplified development of large scale enterprise level application.
  • Application Server/ EJB container provides most of the system level services like transaction handling, logging, load balancing, PERSISTENCE MECHANISM, exception handling and so on. Developer has to focus only on business logic of the application.
  • EJB container manages LIFE CYCLE of ejb instances thus developer needs not to worry about when to create/delete ejb objects.

 

Following are the key benefits of EJB.

 

37.

What Is Ejb?

Answer»

EJB stands for ENTERPRISE Java Beans. EJB is an essential part of a J2EE platform. J2EE platform have component based architecture to provide multi-tiered, distributed and highly transactional features to enterprise level applications.
EJB provides an architecture to DEVELOP and DEPLOY component based enterprise applications considering robustness, high scalability and high PERFORMANCE. An EJB application can be deployed on any of the application server compliant with J2EE 1.3 standard SPECIFICATION.

EJB stands for Enterprise Java Beans. EJB is an essential part of a J2EE platform. J2EE platform have component based architecture to provide multi-tiered, distributed and highly transactional features to enterprise level applications.
EJB provides an architecture to develop and deploy component based enterprise applications considering robustness, high scalability and high performance. An EJB application can be deployed on any of the application server compliant with J2EE 1.3 standard specification.

38.

Describe Different States Of A Thread.

Answer»

A thread in Java can be in either of the following states:
Ready: When a thread is created, it’s in Ready STATE.
Running: A thread currently being EXECUTED is in running state.
Waiting: A thread waiting for another thread to free certain resources is in waiting state.
DEAD: A thread which has GONE dead after EXECUTION is in dead state.

A thread in Java can be in either of the following states:
Ready: When a thread is created, it’s in Ready state.
Running: A thread currently being executed is in running state.
Waiting: A thread waiting for another thread to free certain resources is in waiting state.
Dead: A thread which has gone dead after execution is in dead state.

39.

Which Types Of Exceptions Are Caught At Compile Time?

Answer»

Checked exceptions can be caught at the TIME of program compilation. Checked exceptions MUST be handled by using try catch block in the CODE in ORDER to SUCCESSFULLY compile the code.

Checked exceptions can be caught at the time of program compilation. Checked exceptions must be handled by using try catch block in the code in order to successfully compile the code.

40.

How Can We Use Primitive Data Types As Objects?

Answer»

Primitive data types like int can be handled as objects by the USE of their respective wrapper CLASSES. For example, Integer is a wrapper class for primitive data type int. We can apply different METHODS to a wrapper class, just like any other OBJECT.

Primitive data types like int can be handled as objects by the use of their respective wrapper classes. For example, Integer is a wrapper class for primitive data type int. We can apply different methods to a wrapper class, just like any other object.

41.

Can A Class In Java Be Inherited From More Than One Class?

Answer»

In Java, a CLASS can be derived from only one class and not from MULTIPLE CLASSES. Multiple INHERITANCES is not supported by Java.

In Java, a class can be derived from only one class and not from multiple classes. Multiple inheritances is not supported by Java.

42.

Can Variables Be Used In Java Without Initialization?

Answer»

In Java, if a variable is used in a code without prior initialization by a valid value, program doesn’t COMPILE and GIVES an error as no DEFAULT value is ASSIGNED to variables in Java.

In Java, if a variable is used in a code without prior initialization by a valid value, program doesn’t compile and gives an error as no default value is assigned to variables in Java.

43.

What Are The Two Environment Variables That Must Be Set In Order To Run Any Java Programs?

Answer»

 Java programs can be EXECUTED in a machine only once FOLLOWING two ENVIRONMENT variables have been properly SET:

  1. PATH variable
  2. CLASSPATH variable

 Java programs can be executed in a machine only once following two environment variables have been properly set:

44.

Can We Call A Non-static Method From Inside A Static Method?

Answer»

Non-Static methods are owned by objects of a CLASS and have object level scope and in order to call the non-Static methods from a static block (LIKE from a static main method), an object of the class NEEDS to be created FIRST. Then using object reference, these methods can be invoked.

 

Non-Static methods are owned by objects of a class and have object level scope and in order to call the non-Static methods from a static block (like from a static main method), an object of the class needs to be created first. Then using object reference, these methods can be invoked.

 

45.

A Person Says That He Compiled A Java Class Successfully Without Even Having A Main Method In It? Is It Possible?

Answer»

main method is an entry point of Java CLASS and is required for EXECUTION of the PROGRAM HOWEVER; a class gets compiled successfully even if it doesn’t have a main method. It can’t be RUN though.

main method is an entry point of Java class and is required for execution of the program however; a class gets compiled successfully even if it doesn’t have a main method. It can’t be run though.

46.

Can A Dead Thread Be Started Again?

Answer»

In java, a THREAD which is in DEAD state can’t be started again. There is no WAY to RESTART a dead thread.

In java, a thread which is in dead state can’t be started again. There is no way to restart a dead thread.

47.

Can We Use Goto In Java To Go To A Particular Line?

Answer»

In JAVA, there is not GOTO keyword and java doesn’t SUPPORT this feature of going to a PARTICULAR labeled line.

 

In Java, there is not goto keyword and java doesn’t support this feature of going to a particular labeled line.

 

48.

Can A Constructor Have Different Name Than A Class Name In Java?

Answer»

Constructor in Java must have same NAME as the CLASS name and if the name is DIFFERENT, it doesn’t act as a constructor and compiler thinks of it as a normal method.

Constructor in Java must have same name as the class name and if the name is different, it doesn’t act as a constructor and compiler thinks of it as a normal method.

49.

Is Jdk Required On Each Machine To Run A Java Program?

Answer»

JDK is development KIT of Java and is REQUIRED for development only and to run a Java PROGRAM on a MACHINE, JDK isn’t required. Only JRE is required.

JDK is development Kit of Java and is required for development only and to run a Java program on a machine, JDK isn’t required. Only JRE is required.

50.

When Super Keyword Is Used?

Answer»

If the method overrides one of its superclass's methods, OVERRIDDEN method can be invoked through the use of the keyword SUPER. It can be also USED to REFER to a hidden FIELD.

If the method overrides one of its superclass's methods, overridden method can be invoked through the use of the keyword super. It can be also used to refer to a hidden field.