sandip karmarkar

Greenhorn
+ Follow
since Jan 08, 2001
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 sandip karmarkar

Is this DTD code valid ?
<!ELEMENT test (this,that)*>
<!ELEMENT this (#PCDATA)>
<!ELEMENT that (PCDATA)>
I think that this DTD is correct.
Can you please comment on it.
Hello
The attributes are used as adjectives of Elements. The attributes give some more information on elements.
The entities are used to represent repeatable text in an XML document.
For details you can please refer to Professional XML.
Regards
Sandip
Hi
Can you please correct me on the following point if I am wrong.
Constructor is provided by the compiler only if the class does not define any constructor and it calls the default 'no-args' constructor of the super class.
However constructor does not initialize instance members and class ( static ) members of the class.
This initialization is done by 'new' statement at the time of creation of object.
Regards
Sandip

Hi lusha
finalize method can throw exception but it is of no use. No action is taken on exception object created. ( I am not sure whether it is destroyed or not ).
Can someone correct me if it is wrong.
Regards
Sandip
Hi all
This is a question from JQ+.
Compared to public, protected and private accessibility, default accessibility is....
The options are
1.Less restrictive than public
2.More restrictive than public, but less restrictive than protected.
3.More restrictive than protected, but less restrictive than private.
4.More restrictive than private.
5.Less restrictive than protected from within a package, and more restrictive than protected from outside a package.
The answer provided by JQ+ is 3. But I feel the correct answer should be 5.
Can you please correct me if I am wrong.
Regards
Sandip
Hi Zeeshan
Runtime exceptions need not be caught in try catch block. Similarly they need not be declared in method signature.
When RuntimeException reference is directed to null, NullPointerException is thrown.
Regards
Sandip
Hello Can
I could understand upto step 4 but still unclear about step 5.
You are saying "Now the v in the scope of amethod is still referring to the same object as before". Is it true.
Because now v is referring to vh and value of v.i will be 10.
I have run the program and output is 20 but still I fail to understand it, I think it should be 10.
Can you explain.
Regards
Sandip
Hi
You can carry out narrowing of conversion if range of the variable is not a problem. If range of long variable for conversion is within range of interger then narrowing of conversion is possible.
Regards
Sandip
Hi Padmini
I think your statment :IT IS SAID THAT VARIABLES DECLARED AS FINAL DO NOT OCCUPY MEMORY ON A PER INSTANCE BASIS.
in not valid.
The variables declared as final occupy memory on instance basis. In the code if object of class finals is created using first constructor
finals() {
MAX_SIZE=10;
System.out.println(MAX_SIZE);
}
then value of final variable MAX_SIZE is set of 10 for the life time of that object.
Similarly if object of class finals is created using second constructor
finals(int a) {
MAX_SIZE=a;//LINE 2
System.out.println(MAX_SIZE);
}
the value of final variable MAX_SIZE is set to 'a' and is valid and constant for lifetime of that object.
Regards
Sandip
Hello
Yes I also think that answer should be C and not b.
Regards
Sandip
Hi
I think it works like this.
int i=0;
i=i++;
i is assigned value 0 and then value of i is increamented to 1.
However this value ( 1 ) is not assined back to i. It remains in some memory location which can not be accessed by i.
Hence by System.out.println(i) statement 0 is printed as that is the value that has been assined to i.
Hope this clarifies.
Regards
Sandip
Hi Jeena
I have tried the code and following statment also gives compilation errors
((I1)tc).VALUE
Regards
Sandip
Hi Bin
The members of interface are always public even if it is not stated so.
Regards
Sandip
Hi Zeeshan
When you call amethod with 5 it is treated as integer and amethod for integer is called.
If you want to call amethod for long you have to use 5l ot 5L as parameter.
Hope it is clear.
Regard
Sandip
Hi Intizam
Integer has been assigned to byte which is narrowing of conversion. But the narrowing of conversion is taking place within the range of byte which is -128 to 127 and hence should work fine.
Hope this explains.
Regards
Sandip