hemanshow

Greenhorn
+ Follow
since Jun 26, 2000
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 hemanshow

I run a java application (server-side, third party product) on Solaris (SunOS fixdev 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-1). The applications listens on a specified port. I observe that even after killing the application, the port remains blocked for ever. The port gets freed in around 5 min if I run the same application SunOS etsdev0 5.6 Generic_105181-21 sun4u sparc SUNW,Ultra-80. The ports are freed instantaneosly on NT.

If I do netstat, I get the following:
I also noted that the last line of netstat (SYN_SENT) appears intermittently.
> netstat -a| grep 8549
86: *.8549 *.* 0 0 0 0 LISTEN
96:fixdev.8549 172.20.17.48.1500 8760 0 8670 0 CLOSE_WAIT
97:fixdev.8549 gsdev.33023 33580 0 0 0 ESTABLISHED
98:fixdev.8549 fixdev.33758 32768 0 32683 0 CLOSE_WAIT
99:fixdev.8549 172.20.17.48.1503 8760 0 8670 0 CLOSE_WAIT
100:fixdev.8549 172.20.17.48.1504 8760 0 8670 0 CLOSE_WAIT
101:fixdev.8549 fixdev.33759 32768 0 32683 0 CLOSE_WAIT
102:fixdev.8549 172.20.17.48.1505 8760 0 8670 0 CLOSE_WAIT
103:fixdev.8549 172.20.17.48.1506 8760 0 8670 0 CLOSE_WAIT
104:fixdev.8549 172.20.17.48.1508 8760 0 8670 0 CLOSE_WAIT
105:fixdev.8549 fixdev.33766 32768 0 32683 0 CLOSE_WAIT
106:fixdev.8549 172.20.17.48.1509 8760 0 8670 0 CLOSE_WAIT
107:fixdev.8549 172.20.17.48.1510 8760 0 8670 0 CLOSE_WAIT
108:fixdev.8549 fixdev.33775 32768 0 32683 0 CLOSE_WAIT
109:fixdev.8549 172.20.17.48.1511 8760 0 8670 0 CLOSE_WAIT
110:fixdev.8549 172.20.17.48.1512 8760 0 8670 0 CLOSE_WAIT
111:fixdev.8549 fixdev.33776 32768 0 32683 0 CLOSE_WAIT
112:fixdev.8549 172.20.17.48.1513 8760 0 8670 0 CLOSE_WAIT
113:fixdev.8549 172.20.17.48.1514 8760 0 8670 0 CLOSE_WAIT
114:fixdev.8549 fixdev.33789 32768 0 32683 0 CLOSE_WAIT
115:fixdev.8549 172.20.17.48.1515 8760 0 8670 0 CLOSE_WAIT
116:fixdev.8549 172.20.17.48.1517 8760 0 8670 0 CLOSE_WAIT
117:fixdev.8549 172.20.17.48.1518 8760 0 8670 0 CLOSE_WAIT
118:fixdev.8549 fixdev.33790 32768 0 32683 0 CLOSE_WAIT
119:fixdev.8549 172.20.17.48.1519 8760 0 8670 0 CLOSE_WAIT
120:fixdev.8549 172.20.17.48.1520 8760 0 8670 0 CLOSE_WAIT
121:fixdev.8549 fixdev.33797 32768 0 32683 0 CLOSE_WAIT
122:fixdev.8549 172.20.17.48.1521 8760 0 8670 0 CLOSE_WAIT
123:fixdev.8549 172.20.17.48.ingreslock 8760 0 8670 0 CLOSE_WAIT
124:fixdev.8549 fixdev.33804 32768 0 32683 0 CLOSE_WAIT
125:fixdev.8549 172.20.17.48.1525 8760 0 8670 0 CLOSE_WAIT
126:fixdev.8549 172.20.17.48.1527 8760 0 8670 0 CLOSE_WAIT
127:fixdev.8549 172.20.17.48.1528 8760 0 8670 0 CLOSE_WAIT
128:fixdev.8549 fixdev.33806 32768 0 32683 0 CLOSE_WAIT
129:fixdev.8549 172.20.17.48.1529 8760 0 8670 0 CLOSE_WAIT
130:fixdev.8549 172.20.17.48.1530 8760 0 8670 0 CLOSE_WAIT
131:fixdev.8549 fixdev.33817 32768 0 32683 0 CLOSE_WAIT
132:fixdev.8549 172.20.17.48.1531 8760 0 8670 0 CLOSE_WAIT
133:fixdev.8549 172.20.17.48.1532 8760 0 8670 0 CLOSE_WAIT
134:fixdev.8549 fixdev.33822 32768 0 32683 0 CLOSE_WAIT
135:fixdev.8549 172.20.17.48.1533 8760 0 8670 0 CLOSE_WAIT
136:fixdev.8549 172.20.17.48.1534 8760 0 8670 0 CLOSE_WAIT
137:fixdev.8549 172.20.17.48.1536 8760 0 8670 0 CLOSE_WAIT
138:fixdev.8549 fixdev.33823 32768 0 32683 0 CLOSE_WAIT
139:fixdev.8549 172.20.17.48.1537 8760 0 8670 0 CLOSE_WAIT
140:fixdev.8549 172.20.17.48.1539 8760 0 8670 0 CLOSE_WAIT
141:fixdev.8549 fixdev.33836 32768 0 32683 0 CLOSE_WAIT
142:fixdev.8549 172.20.17.48.1540 8760 0 8670 0 CLOSE_WAIT
143:fixdev.8549 172.20.17.48.1541 8760 0 8670 0 CLOSE_WAIT
144:fixdev.8549 fixdev.33837 32768 0 32683 0 CLOSE_WAIT
145:fixdev.8549 172.20.17.48.1542 8760 0 8670 0 CLOSE_WAIT
146:fixdev.8549 172.20.17.48.1543 8760 0 8670 0 CLOSE_WAIT
147:fixdev.8549 172.20.17.48.1544 8760 0 8670 0 CLOSE_WAIT
148:fixdev.8549 fixdev.33846 32768 0 32683 0 CLOSE_WAIT
149:fixdev.8549 172.20.17.48.1547 8760 0 8670 0 CLOSE_WAIT
150:fixdev.8549 172.20.17.48.1548 8760 0 8670 0 CLOSE_WAIT
151:fixdev.8549 fixdev.33853 32768 0 32683 0 CLOSE_WAIT
152:fixdev.8549 172.20.17.48.1549 8760 0 8670 0 CLOSE_WAIT
153:fixdev.8549 172.20.17.48.1550 8760 0 8670 0 CLOSE_WAIT
154:fixdev.8549 172.20.17.48.1551 8760 0 8670 0 CLOSE_WAIT
155:fixdev.8549 fixdev.33854 32768 0 32683 0 CLOSE_WAIT
156:fixdev.8549 172.20.17.48.1552 8760 0 8670 0 CLOSE_WAIT
157:fixdev.8549 172.20.17.48.1553 8760 0 8670 0 CLOSE_WAIT
158:fixdev.8549 fixdev.33869 32768 0 32683 0 CLOSE_WAIT
159:fixdev.8549 172.20.17.48.1555 8760 0 8670 0 CLOSE_WAIT
160:fixdev.8549 172.20.17.48.1556 8760 0 8670 0 CLOSE_WAIT
161:fixdev.8549 fixdev.33870 32768 0 32683 0 CLOSE_WAIT
162:fixdev.8549 172.20.17.48.1557 8760 0 8670 0 CLOSE_WAIT
163:fixdev.8549 172.20.17.48.1558 8760 0 8670 0 CLOSE_WAIT
164:fixdev.8549 172.20.17.48.1559 8760 0 8670 0 CLOSE_WAIT
165:fixdev.8549 fixdev.33877 32768 0 32683 0 CLOSE_WAIT
166:fixdev.8549 172.20.17.48.1560 8760 0 8670 0 CLOSE_WAIT
167:fixdev.8549 172.20.17.48.1561 8760 0 8670 0 CLOSE_WAIT
168:fixdev.8549 fixdev.33884 32768 0 32683 0 CLOSE_WAIT
169:fixdev.8549 172.20.17.48.1562 8760 0 8670 0 CLOSE_WAIT
170:fixdev.8549 172.20.17.48.1564 8760 0 8670 0 CLOSE_WAIT
171:fixdev.8549 fixdev.33885 32768 0 32683 0 CLOSE_WAIT
178:fixdev.36337 fixdev.8549 0 0 32768 0 SYN_SENT

18 years ago
First make sure that the method is actually over-riding and not over-loading.
Now rule is:
Over-riding method can throw :
1.no exception.
2.exception thrown by over-ridden method.
3.any subclass of exception thrown by over-ridden method.
right?
anonymous class can:
1. either implement an interface
2. or extend an abstract class.
I think, always assumed means that if anonymous class is not made from an abstract class, it extends Object. The requirement to assume will only arise when U dunno which class it extends to (i.e. interfae).
so answers 2,3 should be right.
Ofcourse answer is d. Coz after line 9, anObj refeers to a new object which is anObj.toUpperCase(). Remember string objects are immutable, u can't change anything in object. It seems u r changing the same object to uppercase by in reality new string object is returned by method toUpperCase().
Now think the scinerio:
1.Create anObj as StringBuffer.
2.do charAt() as convert each char to upper case.
3.Now u will be modifying teh same object.
right?
A B C D is right. Popup menu can be added to all.
Reason is that all of these inherit java.awt.Component and Component implements java.awt.MenuContainer
I think I m missing some basic compiler dependent stuff :-)
in file TestPackage.java
.......................................
import mypackage.*;
public class TestPackage
{
public static void main(String[] args)
{
MyClass myClassVar = new MyClass();
System.out.println("In the TestPackage Class");
}
}
.......................
in file MyClass.java
...
package mypackage;
public class MyClass
{
public MyClass()
{
System.out.println("My Class Constructor");
}
}
....
If I compile
D:\himanshu\trial>javac -d . *.java
.\MyClass.java:2: Class mypackage.MyClass already defined in MyClass.java.
public class MyClass
^
error: File .\MyClass.java does not contain type MyClass as expected. Please adjust the class path so that the file does not appear in the unnamed pac
kage.
TestPackage.java:6: Class MyClass not found.
MyClass myClassVar = new MyClass();
^
TestPackage.java:6: Class MyClass not found.
MyClass myClassVar = new MyClass();
^
4 errors
XXXXXXXXXXX
1.Can I know the reason?
2.the same code works fine if I declare TestPackage in a package "hisPackage".
3.the same code works if i change import statement in TestPackage to import mypackage.MyClass;
thanx to u all!.
Yeah BrainBench ( ofcourse http://brainbench.com/) covers beyond SCJP scope, but they give a neat certificate, all for free. The mock exams given in javaranch r SCJP oriented. RHE is good and don't be lazy in reffering to other books (Gosling etc.) if U hav any doubts. This saloon will help a lot too.
I did 3-4 mock exams (IBM, BrainBench, few more). Mock exams love to cross boundaries of SCJP. RHE defines the course outline well. SCJP is much simpler and wants U to know definition fundamentals.
I prefer that one should see the code running for each fundamental definition as this helps to visualize the whole scenario. Each fundas has proper logic with it, its not just an emperical rule for the heck of it.
Go ahead!! Best'o'luck.
Revise your answers before U leave test-room, I m too hasty on that :-)
What about java.util.EventObject ?
The idea is that java.util provides basic utilities for variety of things, like Collections, Locale, Events, Permission, Timer etc. Then other packages take from there and develop specific classes. For example for GUI java.awt.AWTEvent took the charge and then further down java.awt.event defines further specific events.
Its Collections Framework and not Collection Framework. :-) Note the 's' in Collections.
Collection, List, Map, Set are interfaces of Collecttions Framework.
Collections is public class with usefull methods to facilitate synchronized access for Collections Framework.
Sun sometimes ends up creating confusing names.
1.static: A transient variable can't be static as only variables attached to objects r relevent to be made transient. Its no use to make a class variable transient as class variable can't be serialized/de-serialized.
2.final: I also read that final vraibles can't be static, can't relate tho. May be that while object is being de-serialized, its not possible for JVM to assign value to the final variable??
right?
Thanx to u all. I cleared SCJP today with 86% (not very impressive tho).. :-).
x1 is 11111111111111111111111111111111 (32 1's )
x2 is 11111111111111111111111111111111 (32 1's )
x1 = x1 >>>31
x2 >>= 31;
now:
x1 = 00000000000000000000000000000001
x2 = 11111111111111111111111111111111
>>> adds o's to left.
>> adds what was already at the most significatnt bit(1's in our case)
M I right?
goto (good use ;-) ) the java doc. See index for equals(. U will whole list.
try:
if( "string".equals( "string" + "" ) ){
System.out.println( "wow, true" );
}else{
System.out.println( "see, false :-)" );
}
AND try ..........
if( "".equals( null ) ){
System.out.println( "wow, true" );
}else{
System.out.println( "see, false :-)" );
}

so every String object can have as many "" object at end.
NOTE : "" != null