ravi jain


{ City } delhi
< Country > india
* Profession *
User No # 41845
Total Questions Posted # 3
Total Answers Posted # 35

Total Answers Posted for My Questions # 14
Total Views for My Questions # 23129

Users Marked my Answers as Correct # 137
Users Marked my Answers as Wrong # 27
Questions / { ravi jain }
Questions Answers Category Views Company eMail

What is JAVA? Why it is platform independent?

NIIT,

10 Core Java 11482

Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.

NIIT,

1 Core Java 6074

diff. b/w JAVA and javascript...

NIIT,

3 Core Java 5573




Answers / { ravi jain }

Question { L&T, 54337 }

What happens when a main method is declared as private?


Answer

in above answer first word is ByteCode

Is This Answer Correct ?    1 Yes 2 No

Question { L&T, 54337 }

What happens when a main method is declared as private?


Answer

Byte that have main() implementation can become starting
point of program .

if a program have no main()

i.e.
public static void main(String[] args)

properly it can't become starting point in application
it can be use through other program which capable to become
starting point.

Is This Answer Correct ?    3 Yes 1 No


Question { Wipro, 7671 }

Name the class that used to read objects directly from a
stream?


Answer

Ans 2
is wrong in fact its apposite is true

i.e.
for reading ObjectInputStream

for writing ObjectOutputStream

Is This Answer Correct ?    4 Yes 0 No

Question { Epoch, 7112 }

How to call static method?


Answer

Simplest thing to remember is

ClassName.staticMetohdName();

Is This Answer Correct ?    1 Yes 0 No

Question { TCS, 24695 }

wahts is mean by thread?


Answer

Thread is sequential path of execution which makes our program asynchronous.

Is This Answer Correct ?    6 Yes 1 No

Question { Fidelity, 10347 }

suppose string s1="rajnish";
string s2="bhaskar";
then what will be happend ?


Answer

2 new string objects will be created in String pool area in JVM.

String are immutable that why they are stores in

different area in JVM

as in case of final variables.

Is This Answer Correct ?    4 Yes 0 No

Question { TCS, 66005 }

can you create interface instance ?


Answer

In my point of view Uday is wrong..

In his code he creates a anonymous class that implements Test
interface.

so, we can't say this is an object of interface.

Is This Answer Correct ?    1 Yes 0 No

Question { Fidelity, 15164 }

callable is interface or class ?


Answer

ur question is confusing if its simple Callable then it is in

java.util.concurrent package else
if it is

CallableStatement interface

CallableStatement is an interface its super interfaces are:-

PreparedStatement
Statement

Is This Answer Correct ?    1 Yes 0 No

Question { 4788 }

using equals method overriding which objects are
compared?i.e same class objects or other class
objects?Explain me.


Answer

we compare with same class object...

let me know when u override equals() method
u code like--->

this.name.equals(obj.name);

so this comparison is with same class object not with
other class.....

if there is other class class object then
ClassCastException may occur due wrong casting...

so be careful while using equals method overriding....

Is This Answer Correct ?    2 Yes 0 No

Question { 5506 }

If set accepts only one argument then how can it compare
two objects to avoid duplicates


Answer

Set compares hash code of new instance which
has to include in set with already containing values in Set.

because of this comparing b/w instances adding in set is slow
in Set and retrieval is fast.

Is This Answer Correct ?    1 Yes 0 No

Question { Bosch, 11021 }

how to convert mm/dd/yy to dd/mm/yy using collections in
java.


Answer

Dear Sankar ur ans is ok bur it has some mistakes

suppose if some one enter month value <12,
this program accept dis as well
can u modify dis so that it wouldn't accept
month value greater than 12...

Ravi jain

Is This Answer Correct ?    2 Yes 2 No

Question { 10608 }

which one is performance wise advantageious from List,Set,Map?


Answer

hi Debapriya,

can u send me some more info on collection...

i.e.

In which kind of application Set is better
In which kind of application Map is better
In which kind of application List is better

just named those kind of applications

thanks in advance...

Is This Answer Correct ?    0 Yes 0 No

Question { Wipro, 8981 }

What is difference between hash mapping and hash table?


Answer

Khalid's answer is right but it has one mistake i.e.

in second point HashMap is also fail-fast...

Is This Answer Correct ?    1 Yes 0 No

Question { TSYS, 26601 }

How to make a class immutable?


Answer

in above ans

marking the all methods as final gives no mean as
class is final.

for methods point of view do not provide any
setter/mutator methods in class.

Is This Answer Correct ?    2 Yes 3 No

Question { iGate, 16932 }

Can we inherit the constructor in a Class?please give one
example.


Answer

we can't inherit constructors because constructors are not the members of a class.

as in case of blocks.

Is This Answer Correct ?    8 Yes 2 No

 [1]   2   3    Next