Sie sind auf Seite 1von 3

Redolent Systems

www.redolentsystems.com

1. What is immutable object? Can you write immutable object?


Immutable Objects are those objects whose state can not be changed once
they are created,
String is an immutable object. Yes we can write immutable object
Like String s=abc;//here s is a reference variable of type String.
2. Does all property of immutable object needs to be final?
To create a object immutable You need to make the class final and all its
member final so that once objects gets crated no one can modify its state. You can
achieve same functionality by making member as non final but private and not
modifying them except in constructor. Also its NOT necessary to have all the
properties final since you can achieve same functionality by making member as non
final but private and not modifying them except in constructor.
3. What is the difference between creating String as new () and literal?
If we use new() method for creating String object the object will be created in
both object pool and outside object pool i.e with in heap memory. And if we use
string literal to create object, object will be created only in object pool.
4. How does substring () inside String works?
Substring() method can be used to get the data between given index from
actual string.
Ex. String s=ramalaxman;
s.substring(1,4);//ama
5. Which two method you need to implement for key Object in HashMap ?

7. How do you handle error condition while writing stored procedure or accessing
stored procedure from java?

Unit No. 2201, 22nd Floor, WTC Bangalore, Brigade Gateway Campus 26/1,
Malleswaram West, Bangalore 560055, India. T : +91 80 6793 5307

Redolent Systems
www.redolentsystems.com

8. What declarations are required for every Java application?


Class and main() method declarations are required for every java application.
9. What is a compilation unit?

10.What are identifiers and what is naming convention?


Identifiers are names in java. example variable names and keywords are
identifiers.
There are some protocols to declare identifiers
i.e
-every identifier should start with a-z,A-Z,_,$
-Except _ and $ any other symbols are not allowed
-0-9 numbers can be used in identifier after first character
11. What is meant by variable?
Variable is a name which is given to memory space where we can store the
data.
12. What are the kinds of variables in Java? What are their uses?
Mainly there are two types of variables area exist in java
i.e
1.)instance variable
2.)class variable
Instance variables can be used to refer objects of a class. class variable can
be used to determine the state of the object.

Unit No. 2201, 22nd Floor, WTC Bangalore, Brigade Gateway Campus 26/1,
Malleswaram West, Bangalore 560055, India. T : +91 80 6793 5307

Redolent Systems
www.redolentsystems.com

13. What are operators and what are the various types of operators available in
Java?
Operators are mathematical expressions which can be used to perform any
mathematical operations between operands.
Types of operatiors::
1.) comparison operator
2.) Increment and decrement operator
3.) Bitwise operator
4.) Assignment operator
5.) Boolean operator
6.) class & object operator
7.) Arithmetic operator
14. Which Java operator is right associativity?
= is called right associative operator
15. What are the programming constructs?

Unit No. 2201, 22nd Floor, WTC Bangalore, Brigade Gateway Campus 26/1,
Malleswaram West, Bangalore 560055, India. T : +91 80 6793 5307

Das könnte Ihnen auch gefallen