amit


{ City } noida
< Country > india
* Profession *
User No # 39861
Total Questions Posted # 1
Total Answers Posted # 33

Total Answers Posted for My Questions # 2
Total Views for My Questions # 26011

Users Marked my Answers as Correct # 308
Users Marked my Answers as Wrong # 54
Answers / { amit }

Question { IBM, 9115 }

did interface can implementation method ? i know its not
possible but my interviewer said its possible ..but how..?
any one have idea ???


Answer

its a not correct
true answer is that
if the interviewer ask that there is any backdoor
to do this then it is correct but "I THINK INTERVIEWER HAD
SOME HANGOVER"
right answer is no
above coding is right but not the answwer
beacuse
1):what he did in this code just define a class inside a
interface and define a method in this class
so question is not solve there is question in a question
and the answer is "YOU JUST BINDING THE B type with this
INTERFACE A"
not method implementation
amitsing2008@gmail.com

Is This Answer Correct ?    0 Yes 1 No

Question { TCS, 4692 }

what is the output???????

public class multireturn
{
public(int assign x ( int x)
{
if(4==x)
{
return 7;
}
else if (7=x+3)
{
return 6;
}
return 5;
}
}


Answer

answer is that compile time error
because what you did i don't know what i saw i know
else if(7=x+3)
it not a condition you are using the assignment operator
in place of (7==x+3)
amitsing2008@gmail.com

Is This Answer Correct ?    7 Yes 0 No


Question { L&T, 12829 }

Which is better approach among four(HttpSession,cookie,URL
Rewriting, Hidden Fields) Session Tracking technic's ? Why ?


Answer

what is better approach or what is optional approach
those are different things,
HttpSession An Object Cookie An Object UrlRewriting Is An Object
I Dont Think So And Hidden Fields IS AN object i am bit of confused

Request.getSession(true/false);

Means Session Is Started In Itself Is Not It I Think It Is
On First Request,
Cookie,

Response.addCookies(Cookie Object);

Means In Response You Want To Add Cookies
But If Cookies Disable,
Means The Things You Want To Add In Response "Means To Track
User By Session Or By Cookie,

Url Rewriting Its An Approach When Cookies Is Disable ,
So Means
encodeUrl(/sjhf);
Different Apporoach,


Hidden Field Is Not A Way To Track User By Session Because Is Java,
Session Object Created Automatically On First Request,

But If You Want To Use All Predefined Approach ,Means You Are Not Aware So You Could Track A
Page On Every Get Or Post Request By

so On every Request By
request.getparameter("amit");
You Could Track Page And You Could Add It
And Then You Could Make On Every Page
A Hidden Field But Problem Is That It Was Just For
Fill Up Page But
In Next You Could Add It AS COOKIE OR CREATE IT AS COOKIE
OBJECT ,
COOKIE C= NEW COOKIE("AMIT/ALBERT");
SO YOU COULD DO ANYTHING THAT THE WAY YOU WANT
AND
SESSION WILL BE THERE BUT IN JAVA ITS ALMOST
DONE BY SESSION ID AND THAT ID WILL AS COOKIE
CONFUSED THEN DO PRACTICAL

Is This Answer Correct ?    5 Yes 3 No

Prev    1   2    [3]