challa

Greenhorn
+ Follow
since Mar 28, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by challa

Hi friends,

We are using Struts in our project. when the user double clicks any button or link the same action file is called twice and so we are getting various errors. How can we solve this problem? I tried with isTokenValid() but its not working fine as we are using velocity for templates(i.e view part).

Can any please help???
18 years ago
Hi,

Can anyone solve this requirement?
When the user clicks logout from his account and then clicks back button in the browser to access his account, he should be notified to login again.

How to solve this using javascript/html?
Eric,

Can you please tell me, using java script how to load the same page when the user clicks the back button.
Hi,
Can anyone please tell how retrieve servlet context object?
Hi,
Can anyone suggest me a good tutorial for hibernate.
Hi,
Can anyone please tell me how to disable back button in the browser. When the user clicks back button he should get the same page. Please help me how to do this.
public class Ternary

{

public static void main(String args[])

{

int a = 5;

System.out.println("Value is - " + ((a < 5) ? 9.9 : 9));

}

}


I thought the output is
value is - 9

but the output is
value is -9.0

why? can anyone please explain?
sagar,

In the code we are calling a.exec(); ,here a is a reference of subclass only then why it is printing parent.

anyone please explain.

Purnima.
hi,

In Khalid Mughal book it is given that && has more precedence than || operator. However when iam executing ur code iam getting true,false,false
even if iam changing the code as

boolean x = (a = true) || ((b = true) && (c = true)); iam getting the same result. In this case right hand operator should be evaluated first,then b becomes true and then || is evaluated. How come iam getting the same result.can any one please explain.

regards
purnima.
kalyani,
Iam sorry i didnt get you.Moreover what about the fields why it is printing parent in both the cases.

can anyone please explain me the above code.
Shankar,
I understood ur answer.I have a small doubt in the i think a++ is never reached because m1() throws exception explictly then why doesn't the compiler show error.

Please any one make clear this point.
package inheritance;

class B {
String str = "Parent";
static void print() {
System.out.println("Parent Class");
}
void exec() {
print();
System.out.println(str);
}
}


public class Acls extends B {
String str = "Child";
static void print() {
System.out.println("Child Class");
}
public static void main(String[] args) {
Acls a = new Acls();
a.exec();
B b = new Acls();
b.exec();
}
}

the ouput is parent class
parent
parent class
parent

can anyone explain the above code clearly
Hi,
'\u000a' is a newline char and the code at compile time changes to

//char c2= '
\u000a';

this causes the error unclosed literal. This does not happen with your second code because compiler does not go through multiline comment as it does with the single line comment.

hope it is clear.
class ColorException extends Exception {}

class WhiteException extends ColorException {}

class White
{
void m1() throws ColorException
{
throw new WhiteException();
}
void m2() throws WhiteException {}

public static void main (String[] args)
{
White white = new White();
int a,b,d,f; a = b = d = f = 0;
try
{
white.m1();
a++;
} catch (ColorException e) {b++;}
try
{
white.m2();
d++;
} catch (WhiteException e) {f++;}
System.out.print(a+","+b+","+d+","+f);
}
}

This output of the above program is 0,1,1,0.

can anyone explain how the program works.