Android interview questions and answers for Experienced (1 to 2 years) Part-1
1. Explain Java Final Keyword ?
Final variable can be assigned only once.
Final method can not be overriden in subclass.
Final classes can not be extended.
2.Can a final class in java be extended ?
NO. Java classes declared as final cannot be extended.
3.Explain Java Static Keyword ?
Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables
A single copy to be shared by all instances of the class
A static variable can be accessed directly by the class name and doesn’t need any object
Java instance variables are given separate memory for storage. If there is a need for a variable to be common to all the objects of a single java class,
Similar to static variables, java static methods are also common to classes and not tied to a java instance.
4.How are the exceptions handled in java?
When an exception occurs the execution of the program is transferred to an appropriate exception handler.The try-catch-finally block is used to handle the exception.
5.What is unchecked exception(Runtime Exception )?
Runtime exceptions represent problems that are the result of a programming problem such as dividing by zero, trying to access an object through a null reference.
Runtime exceptions need not be explicitly caught in try catch block as it can occur anywhere in a program.
The solution to rectify is to correct the programming logic where the exception has occurred or provide a check.
6.What is checked exception?
Checked exception are the exceptions which forces the programmer to catch them explicitly in try-catch block. It is a subClass of Exception. Example: IOException.
7.Use of java private constructor?
Private constructors prevent a class from being explicitly instantiated by its callers.
There are some common cases where a private constructor can be useful:
classes containing only static utility methods
classes containing only constants
type safe enumerations
singletons
8.What is Intents and Intent Filters ?
The core components of an application — activities, services, and broadcast receivers — are activated through messages, called intents.
Intent filter describes a capability of the core components(activities, services, and broadcast receivers).
9.What is AndroidManifest File?
AndroidManifest file is a root directory of Android applications which contains all the details needed by the android system about the application.
10.Explain Service LifeCycle of Android?
11.What is a content provider?
A SQLite database is private to the application which creates it. If you want to share data with other applications you can use a content provider.
Its is typically used to share data with other application.
I will update more Android interview questions and answers. Stay tuned.
For More Updates Like us on Facebook
Final variable can be assigned only once.
Final method can not be overriden in subclass.
Final classes can not be extended.
2.Can a final class in java be extended ?
NO. Java classes declared as final cannot be extended.
3.Explain Java Static Keyword ?
Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables
A single copy to be shared by all instances of the class
A static variable can be accessed directly by the class name and doesn’t need any object
Java instance variables are given separate memory for storage. If there is a need for a variable to be common to all the objects of a single java class,
Similar to static variables, java static methods are also common to classes and not tied to a java instance.
4.How are the exceptions handled in java?
When an exception occurs the execution of the program is transferred to an appropriate exception handler.The try-catch-finally block is used to handle the exception.
5.What is unchecked exception(Runtime Exception )?
Runtime exceptions represent problems that are the result of a programming problem such as dividing by zero, trying to access an object through a null reference.
Runtime exceptions need not be explicitly caught in try catch block as it can occur anywhere in a program.
The solution to rectify is to correct the programming logic where the exception has occurred or provide a check.
6.What is checked exception?
Checked exception are the exceptions which forces the programmer to catch them explicitly in try-catch block. It is a subClass of Exception. Example: IOException.
7.Use of java private constructor?
Private constructors prevent a class from being explicitly instantiated by its callers.
There are some common cases where a private constructor can be useful:
classes containing only static utility methods
classes containing only constants
type safe enumerations
singletons
8.What is Intents and Intent Filters ?
The core components of an application — activities, services, and broadcast receivers — are activated through messages, called intents.
Intent filter describes a capability of the core components(activities, services, and broadcast receivers).
9.What is AndroidManifest File?
AndroidManifest file is a root directory of Android applications which contains all the details needed by the android system about the application.
10.Explain Service LifeCycle of Android?
11.What is a content provider?
A SQLite database is private to the application which creates it. If you want to share data with other applications you can use a content provider.
Its is typically used to share data with other application.
I will update more Android interview questions and answers. Stay tuned.
For More Updates Like us on Facebook