This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!

prafulla shrikhande

Greenhorn
+ Follow
since Mar 12, 2003
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 prafulla shrikhande

We are using WAS 5.0.2 for J2EE application.
OS - Solaris 8 with 8 GB Total Memory.

I've read that WAS recommended MaxHeap size should be 1/4 of total memory and thus it is set to 2GB. Lately, we are experiencing performance issues and I am wondering if we need to increase the HeapSize to say, 4 GB.
I will be doing some load tests at various heap sizes but would like to know from your experience what percent of total memory should WAS heap size consume. Also, what percent of the Max should the Min Heap size be?
I've read that Min be anywhere from 1/4 of Max to same as Max.

cheers
praful
16 years ago
How do you access enclosing class' super class variables.
I know about <outer>.this.<variable>
Is there such a thing like <outer>.super.<variable>

Look at the code below -

class SuperA {String s1="SuperA";}
class SuperB {String s1="SuperB";}
class A extends SuperA {
String s1="A";
class B extends SuperB { // 1
String s1="B";
void m1() {
System.out.print(this.s1 + ","); // 2
System.out.print(super.s1 + ","); // 3
System.out.print(A.this.s1 + ","); // 4
System.out.print(A.super.s1); // 5
}
}
public static void main (String[] args) {
new A().new B().m1(); // 6
}}

What is the result of attempting to compile and run the program?

a. Prints: B,SuperB,B,SuperB
b. Prints: B,SuperB,A,SuperA
c. Compile-time error at 1.
d. Compile-time error at 2.
e. Compile-time error at 3.
f. Compile-time error at 4.
g. Compile-time error at 5.
h. Compile-time error at 6.
i. Run-time error
j. None of the above
I found this question in one of the mock exams and was doubtful about the sequence of creation -

class A {
A() {System.out.print("CA ");}
static {System.out.print("SA ");}
}
class B extends A {
B() {System.out.print("CB ");}
static {System.out.print("SB ");}
public static void main (String[] args) {B b = new B();}
}

What is the result of attempting to compile and run the above program?

a. Prints: SA CA SB CB
b. Prints: SA SB CA CB
c. Prints: SB SA CA CB
d. Prints: SB CB SA CA
e. Runtime Exception
f. Compiler Error
g. None of the above


As i understand, the subclass static block is called after the invocation of superclass contructor and I would expect the answer to be (a). But the answer was found to be (b). Any ideas??
this was a good one on bitwise operators -

i = 1;

i <<= 31;
i >>= 31;
i >>= 1;

whats the value of i?