Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Garg Sharad

Greenhorn
+ Follow
since Jun 20, 2009
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 Garg Sharad

The answer would be 10.
10 years ago
The Output of below statement is correct because
((AClass)b).m(); // Does compile and return B\nSuper:\nA

There are two things happening

one is compile time polymorphism.
It's happening because you are doing BClass object type cast with AClass object so this thing checked at compile time.

second run time polymorphism.
At run time even you are using sub class object with super class reference it'll call sub class object method.



You are getting compile time error at

b.m(); // Does not compile

line because method m access modifier is protected and you can not use out of protected member out side the package without using inheritence.



Hi,

Is there any body having idea how can i set maximum size for server log in jboss because my server log size is increasing frequently so i am unable to open it.

Please let me know if anybody is having idea about it.
Hi All,

I cleared SCJP 6 with 95% marks.

Thanks all rancher's.

11 years ago
Thanks for your clarification

-Sharad


Output of this prograe is nullpointer exception

Can anybody tell me why it is showing nullpointer exception.

While Code



is producing output: 1

Please tell me if any body is having idea abt it....

Thanks
-Sharad Garg
static - any code block or instance constructor or method can set this so long as it has access
final - must be initialised at declaration, in a code block or in an constructor. Once initialised, it cannot be changed.
final int i;
public Test() {
i=15;
}
static final - must be initialised at declaration, or in a static code block. Once initialised, it cannot be changed (and that includes instance constructors).

static final int i;
static
{
i = 10;
}
Test(){}


sumit Bhatnagar wrote:Hi,
I have cleared SCJP examination with 97% marks.




Congra8s Sumit

[DELETED]
11 years ago
Please give me solution of this Exception
java.sql.SQLException: Parameter index out of bounds. 6 is not between valid values of 1 and 5

Hi Adrian Bucur,

Could you please tell me how many drag and drop question was there, Because i am also planing to give SCJP 6 exam in next month.

Thanks in advance.

--Sharad
11 years ago
In this case only one object (t1) will be able to GC because t.b1 and t1.b2 are only the reference variable so they will not available for GC.

Madhu Desai wrote:Thanks Mason Storm

I think this is correct representation...



Still...where exactly will class's static variable be? - Stack or Heap?




object of a class always created in HEAP.
Can you please share me the code of Class X.