This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud and have Kyle Brown, Bobby Woolf and Joseph Yodor on-line!
See this thread for details.

Rippon Jalali

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

Recent posts by Rippon Jalali

I downloaded tomcat6.0 from the website.after starting tomcat,when i log on to
http://localhost:8080(i am using 8080 port for this).It is showing me the congratulation page saying i have successfully setup tomcat.But when i click on tomcat manager ,it doesn't ask for username and password.And directly shows me the 401 ERROR.Error is as:>

type Status report
message
description This request requires HTTP authentication ().


Apache Tomcat/6.0.13
18 years ago
Thanks for all of your help.
18 years ago
"sorry the previuos one had a mistake".I am repeating again.But even if you throw exception other than general 'Exception' like 'ClassCastException'.Still it doesn't catch that exception.
18 years ago
but even if you throw exception other than general 'Exception' like 'ClassCastException'.Still it doesn't throw exception.
18 years ago
As the calls to "STRING ".toUpperCase() == "STRING" does not change anything, the reference to the orignal unchanged string in the pool is returned.
18 years ago
but when we are comparing string literals there is no need of equals method.As when we run the code below.it gives output "Equal".
if("String".toString() == "String")

System.out.println("Equal");

else

System.out.println("Not Equal");
18 years ago
the below given code gives "Not Equal". But as trim() returns a string whose value is string used to invoke the method but with any leading or trailing blank spaces removed. So isn't the condition result in true and output be "Equal"?

if(" String ".trim() == "String")

System.out.println("Equal");

else

System.out.println("Not Equal");
18 years ago
when i am trying to run below program.the output comes='0'.
BUt shouldn't it come '1'.


public class t {
public static void main(String argv[]) {

int i =0;

i=i++;
System.out.println(i);
}


}
18 years ago
But as shown in the simple program below,never a exception can be thrown in try block.BUt prog compiles fine and runs


public class t {
public static void main(String[] args) {
int i = 2;
try {
i=9;

} catch (Exception ae){
System.err.println(" exception caught");
}
System.out.println(i);
}
}
18 years ago
But whenver we write a try catch block.It is not necessary that exception will occur .It may or may not occur.
The error comes:
t.java:7: exception java.io.IOException is never thrown in body of corresponding
try statement
}catch(IOException ioe){}
18 years ago
when i run the program below it gives compiler error saying that myref.test() does not throw exception.but as i know it is not necessary that the code should throw the exception


import java.io.*;
public class TechnoSample {
public static void main(String[] args) {
TechnoSampleSub myref = new TechnoSampleSub();
try{
myref.test();
}catch(IOException ioe){}
}
void test() throws IOException{
System.out.println("In TechnoSample");
throw new IOException();
}
}
class TechnoSampleSub extends TechnoSample {
void test() {
System.out.println("In TechnoSampleSub");
}
}
18 years ago
i checked it for:
if(array instanceof int[]).
it is working .And ofcourse the answer should be (4).Thank you for your response
18 years ago
actually the question was like this
# instanceof operator can be used with ...

1. interfaces
2. Arrays
3. Classes
4. All of the above

so should answer be the (4)
18 years ago
i want to ask a question that whether we can use instanceof operator with arrays?
18 years ago
The problem in the code below is that catch clause in the called method rethrows exception,and main method neither handles nor declares the exception.So shouldn't it give compiler error?but it isgiving answer 3.
Can any body explain.

public class Test3{
public static void main(String args[]){
System.out.println(method());
}
public static int method(){
try{
throw new Exception();
}
catch(Exception e){
throw new Exception();
}
finally{
return 3;
}
}
}
18 years ago