SomeswaraRao Vudattula

Greenhorn
+ Follow
since Mar 28, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by SomeswaraRao Vudattula

i have send some messages to Oracle AQ, now i want to recive those messages by using MDB from weblogic..?

how to configuring the MDB For accessing the Oracle AQ

Thanks in Advance
-Somesh
16 years ago
JSP is Java code embedded in HTML; the Java code is compiled (if necessary) and run by the container on the server and the client only sees the results of that code's execution mixed in appropriately with the html.

Servlets are compiled pure Java class files (not mixed with HTML) that get posts from the client and send html to in return.

Both require a container on the server, such as Tomcat, which provides the environment and VM for the Java program.
18 years ago
Can u pls suggest some good material or good links for web services
18 years ago
what is the advantages of annotations
18 years ago
Hi,

First We need to know one thing..Individual Static BLock with Variable X is not accessible for Main().. so X=0 and y=0 in main()

before coming to this following exp x = -1 and y = 0
y = x++ + ++x;
in this exp first x++ will be executed -> x++
-> x= -1 + 1
-> x= 0
in this exp next ++x will be executed -> ++x
-> x = 0 + 1
-> x = 0
next we will go for total exp

y = x++ + ++x
y = 0 + 0
y = 0
Hi Chitra,

already we know
"==" copmares the heap memorylocations of Strings and
.equals() compares the contents of Strings..

in this case, " String " == "String"
first String will create once.. and second String will create once again..because both r diff..Strings...so there memory locations r diff
so..

if(" String ".trim()== ("String"))
System.out.println("Equal");
else
System.out.println("Not Equal");

OutPut: Not Equal

but if u modify the code like this..

if(" String ".trim().equals("String"))
System.out.println("Equal");
else
System.out.println("Not Equal");

OutPut: Equal
Hi Chitra and Lalitha,

pls here me....

when u r printing the object directly..it will call toString() internally... so that value will be null.so it is showing Null Pointer Exception..
SYstem.Out.println(t);

in this case :
System.out.println("T1:"+t1);
t1 is null..but ist is adding with String.. so it will show T1:null;
in this Case :

System.out.println("T1:"+t1.toString());
here also it returns null but it will concatinate with String and showing T1:null
Hi Chitra,

when u r declaring the final var and using.. thete.. no probes...i meen no need the casting..

but when u r using the other class final var int,we need the casting.. because.. until runtime that dont know the type of variable.. so it need casting...

i hope now u r clear...
String str;
str = "one" + "two" + "three" + "four";


in the above two lines of code how many Strings will be created..?
what is the solution for minimising the number of Strings..?
Sandeep,

A,B,C shows the incomparable types error...so they wont compile...
D,E returns false because equals method comparing the references, in Strings only it compares the content..not in others...so it returns false
F also shows compiler error..because equals method needs object as arguement

-Somesh
StringBuffer s1 = new StringBuffer("Somesh");
StringBuffer s2 = new StringBuffer("Somesh");
System.out.println(s1.equals(s2));
System.out.println(s1==s2);
OutPut:-
false
false

why it is showing like this..? Please Explain....
how to compare/equal the StringBuffer..?

-Somesh
soni,

at the time of declaring the variables the following process will be done..

str1 = "somu";
//Compiler create new reference for this String.
str2 = "somu";
//Compiler check the String Pool,if it found the same content, compiler will assign to that exist reference..other wise it will create new one.

"==" compares the references so it shown true
.equals() compares the content so it is also shown true


but in the following case, it will craete always new references because we r using the new operator

String str1 = new String("somu");
String str2 = new String("somu");