Win a copy of Spring Boot in Practice this week in the Spring forum!

Rekha Anand

Ranch Hand
+ Follow
since Feb 23, 2008
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 Rekha Anand

Hello.

I installed NetBeans 6.1 on my PC. I also have Sun Java System Application Server on my PC. When I tried to connect Java DB I got the following error:

Could not listen on port 1527 on host localhost:
java.net.BindException: Address already in use: JVM_Bind


Can you please explain me this and help find the solution..?

Regards
Rekha
[ May 14, 2008: Message edited by: Bear Bibeault ]
Thanks.

I read the servlet specs. But it did not have the solution to my problem. I would like to create the war file step by step. Please help.

Regards
Rekha
14 years ago
Hello.

I downloaded JSWDK from Sun website. It comes along with a web application server. I was able to deploy a sample web application that came with the download.

Now, I have written my first servlet FirstServ.java
In order to deploy it, I need to create a war file. I know how to create a war file, but there must also be a web.xml file associated with the application. I read that web.xml should reside in web-inf directory but I did not find such a directory. Do I have to create it? Where?
Could you please help me step by step...?

Regards
Rekha
[ May 13, 2008: Message edited by: Rekha Anand ]
14 years ago
Thanks!!

Do I write servlet code in jdk just as regular java code?

Rekha
14 years ago
Hello all...

I am preparing to dive in the pool of Servlets and JSPs. What (software/application) is it that I need to have on my personal computer to start coding and testing servlets..?

Regards,

Rekha Anand
[ May 12, 2008: Message edited by: Bear Bibeault ]
14 years ago
Thanks for the help!!

Rekha
14 years ago
Hello All,

As per
http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedHashSet.html

the default initial capacity of a LinkedHashSet is 16. So, if I construct a new LinkedHashSet as below...
LinkedHashSet lhset = new LinkedHashSet();

The default capacity of lhset will be 16. I tried adding 20 elements in lhset. All the elements were added without any problem.

Q. Does this mean the collections increase their size automatically?

Q. size and capacity are two different parameters of any collection. After adding 20 elements, i got lhset.size() == 20. How do I find the "capacity" of lhset?

Regards,
Rekha
14 years ago
Thanks!! It helped.

Rekha
14 years ago
Warm Regards to All Java Ranchers...

Please have a look at the following program...

public class Test7{
public Test7(){
this(4);
}
public Test7(short var){ // Line-1
System.out.println(var);
}
public static void main(String[] args){
Test7 t7 = new Test7();
}
}


This code gives compile time error. The problem is with the constructor call
this(4);

If I change the data type in Line-1 from short to int, the code compiles fine. Why am I getting this error although 4 lies in the range of short type..?

Thanks..
Rekha
14 years ago
Hello All,

I am sorry I took long to reply. I appreciate from the bottom of my heart the effort you all have put in to help me understand shifting. I tried some questions manually and was able to solve. There is still slight problem with >>> for negative numbers such as -16>>>3, the 32 bits are over-whelming. For instance...

-16>>>3
-16 : 11111111 11111111 11111111 11110000
-16>>>3 : 11111 11111111 11111111 11111110000
0 Fill: 00011111 11111111 11111111 11111110

Now that I have done the shifting " HOW DO I CONVERT THIS BIG BINARY NUMBER INTO DECIMAL DURING THE EXAM..?" It will take up a lot of time.

Thanks & Regards
Rekha
Hello All.

I have started giving mock tests available on the internet. One problem that I see is that I get stuck in the questions involving shift operators. While learning about shift operators I used calculators to get to the right answer. But calculators are not allowed in the final exam. I get nervous when I come across big numbers carrying only 0's and 1's. Is there any short cut method of solving questions involving shift operators? For example: -4 >>> 3. Could someone tell me all the steps in solving this problem?

Thanks & Regards,
Rekha
O Ok..
So that means the i referred in the //** line is same as the argument int i[] of the change method. And the output should be 1..??

Regards,
Rekha
14 years ago
Can someone please tell me what is happening in the line marked //** ?


public class example {
int i[] = {0};
public static void main(String args[]) {
int i[] = {1};
change_i(i);
System.out.println(i[0]);
}
public static void change_i(int i[]) {
int j[] = {2};
i = j; // **
}
}

Regards,
Rekha
14 years ago
I Thank You All for yor precious help !!!
14 years ago
Hello All,

The following program prints "Both are not equal"... I cannot understand WHY? Please help.



public class T3
{
public static void main(String arg[])
{
String str = "Java";
StringBuffer buffer = new StringBuffer(str);
if(str.equals(buffer))
{
System.out.println("Both are equal");
}
else
{
System.out.println("Both are not equal");
}
}
}
14 years ago