Win a copy of Securing DevOps this week in the Security forum!

Satish Kota

Ranch Hand
+ Follow
since Feb 08, 2006
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 Satish Kota

Hi Ranchers,
I am posting this beacause i am in kind of dielemma. I have recently attended an interview for a US product based company in INDIA. I cleared all the tech interviews and in the HR interview when i was asked for the expected salary i said 5.5 Lakhs per annum and the interviewer said okay. But in my offer letter i was offered 5.25 Lakhs per annum. I am confused whether i should negotiate for 5.5 or should i settle for this amount. Personally i like the job profile and i have no problems in working for 5.25 L/A, but some of my friends who recently made it to the same company for similar job profile with same experience as mine are getting 5.5 - 5.75 L/A. So i am confused whether i should negotiate for more and moreover i am worried if this negotiation request may terminate my job offer. Please clarify
[ January 10, 2007: Message edited by: Satish Kota ]
11 years ago
Greate score PETE.
11 years ago
Brilliant score. One of the best i came across
11 years ago
Congratz Kalpesh thats a very good score
11 years ago
Hi Ranchers,
I cleared SCJP with 77%. Thanks to all of you
11 years ago
Congratz Michael. I have my SCJP 5.0 in 2:30 Min. Lets see how i fare
11 years ago

Originally posted by ramya sri:
How can a construcor declared that it throws Exception,wat is the use of the declaration, the block that uses constructor must be enclosed in "TRY" or not. and wat about the inherited class construtor(the Question is some what ambiguous)



super() must be the 1st statement. Hence the only way a subclass constructor handles the exception is by declaring that it throws it, in such case the method which instantiates this class must handle or declare exception. See this example:

Hi Ranchers,
I am working in an indian software company since last 17 months as software programmer in Java, Jsp and Struts. I have read lots of articles and books on salary negotiations which always emphasises on identifying your market value before the negotiation. But i donot undertsand how does one actually come to know his/her market value. What are the parameters that constitute an individual's market value.
[ December 14, 2006: Message edited by: Satish Kota ]
11 years ago

Originally posted by Mark Uppeteer:
source: Me

Hi guys, this was something I found on my 'to try' pages. No big surprises here but it shows the inner class can save the outer class from the evil gc.



regards,
Mark



In above code if we make dad null is ithe dad object eligible for GC as there is no reference pointing to Dad object ?
Hi,

One of my Java Processes on Solaris Core Dumped due to SIGNAL 11 (SIGENV) and SIGNAL 10 (SIGBUS). SIgnal 11 is caused due to a Segmentation fault and Signal 10 is caused due to a 'Bus error' (hardware error).

I would like to know, which is the best debugger to debug this core dump (java) and know the root cause. I tried 'gdb' but I am not sure if 'gdb' works for java. I would like to get a neat stack trace of the error.

Any help is appreciated.

Thanks.
11 years ago

Originally posted by Keith Lynn:
The reason is that subclasses can implements interfaces that are not implemented by their superclasses.

If you have a non-final class, A, which does not implement an interface, B, it is possible that a reference of type A actually refers to an object created from a subclass of A which does implement B. So for this reason, casts at compile-time are allowed.

However, if class A is final, then it cannot have subclasses.



Thanks Keith that clarifies my doubt

Originally posted by Keith Lynn:


However, at compile-time a cast to an interface type is always allowed except in the case where the runtime type of the RelationalExpression is a final class.



Keith,
Can you please explain why does java compiler allways allow a cast to any interface which is not in an hierarachy and why is it not allowed if the class is a final class. I meant why this is allowed to compile:



This code compiles fine. But produces class cast exception at runtime. Exception produced is understandable as b is not in hierarchy with I1.But my doubt is when such a cast is definite to produce an exception why is it allowed to compile at first place.

But in the above code if i make class B as final class it works fine as expected, producing compile time error. Here is the code:



Produces the following error:
test.java:16: inconvertible types
found : B
required: I1
i=(I1)b;
^
test.java:17: inconvertible types
found : B
required: I1
System.out.println(b instanceof I1);
^
2 errors



I would like to know what is the logic behind allowing non-final class reference to be cast to any interface(not in hierarchy) and not allowing final class reference to be cast to an interface(not in hierarchy)




[ December 12, 2006: Message edited by: Satish Kota ]
Hmm! This is very strange. I just checked it and it compiling fine. I dont understand why is this happening even after visiting the link given. Some one please clarify this.

Originally posted by Aniruddha Jadhao:
Hi
I have one confusion for instace of oprator .
Instance of operator chks the reference to the hirarchy of the class on Right side otherwise der will be compiler error right?.
if we tak an e.g HashMap o1 = new HashMap();
System.ot.print("tru/false-->"01 instanceof Collection);

Now when i ran the code , it complied successfully & prints false.
but my Q? is as Collection interface nither extended/implementd by any of the ansecstors of Map how this program can run w/out cimplier error?

thanks

aniruddha

Originally posted by sentil kumar:
class outer {
void show() {
final int a =1;
int b =12;
class minner extends outer{
public void show1(){
System.out.println("method--"+a);
}
}
}
b can not be accessed by minner class. because a will be exist in stack.
but we can access the a ,where the final variable a will be stored.



Hi Sentil,
In case of final variables a copy of it wil be stored inside the method local inner class. As final variables are not going to change their values having a copy of it inside method local inner class wont create any inconsistency. So even after the method is completed the final variable accessd by Method Local inner class will remain on the heap.