Win a copy of Spring Boot in Practice this week in the Spring forum!

Vidya sumanasekara

Greenhorn
+ Follow
since Feb 03, 2011
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 Vidya sumanasekara

anirudh jagithyala wrote:

int/double=double;;;;double/int=double
therefore 3/2d=3/2.0=1.5(double)=1.5
d2=1.5


Hope it is clear



Oh....I got it...Thanks. the case is "2d"...


Out put:-
1.0 1.5

Why it gives two different output...
help me....

kurt hanni wrote:You are running Parent class, you dont have a main method in your Parent class




yes .... Thanks..

Then output:-

Staticblock Parent
Staticblock Parent 2
Staticblock Child
Initblock Parent
Constructor Parent
Initblock Child
Initblock Child 2
Constructor Child A
Constructor Child

Can you explain me....



out put:-
Staticblock Parent
Staticblock Parent 2
Exception in thread "main" java.lang.NoSuchMethodError: main


Help me to understand this output....
Hi...
I am new to struts framework. So What are the best references for studying struts.....

11 years ago
int[] a = null , b [] = null; This is same as 1-D a[] and 2-D b[][] is n't it..

Ok..thank you all of you


Hareendra Reddy wrote:Hello Vidya sumanasekara ,
The problem here is this line

Now b is interpreted by compiler as 2-D array i.e b[][] ,
notice that a array if int type and b array of array of ints ..

HTH



Output
arr.java:4: incompatible types
found : int[]
required: int[][]
b = a;
^
1 error


Can any one please help me to understand the output....
Thanks...every body ....

i got it...
Hi,
can any one explain me the output?

code:-

output:-
child.eat(j)
child.eat(j)

Thanks...
This happens because of the overriding...

In the supper class Animal -> void makeNoise()

In the sub class Dog-> void makeNoise()//overriden method & playDead()// this is unique for this class

Then you have assining a dog instance to the Animal reference ( in the loop)

In that case compiler check
Animal animal=new Dog();
first reference type (Animal) where there is playDead() method and runtime check the instance type. ok..
In your case there is no any method playDead() in Animal class..so compiler gives an error..

Hennry Smith wrote:


When we try to compile this code, the compiler says something like this:
cannot find symbol
The compiler is saying, "Hey, class Animal doesn't have a playDead() method".
Let's modify the if code block:
if(animal instanceof Dog) {
Dog d = (Dog) animal; // casting the ref. var.
d.playDead();
}





Please explain i am not able to understand this concept...???