A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Please tell me the program flow..
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
posted
Oct 27, 2009 07:28:45
0
package Test2; interface InterfaceA { int A = 2 * InterfaceB.B; } interface InterfaceB { int B = InterfaceC.C + 1; } interface InterfaceC extends InterfaceA { int C = InterfaceA.A + 1; } public class TestInterface implements InterfaceB,InterfaceC { static int g = A+B + C ; public static void main(String args[]) { System.out.println(g); } }
Please tell me the flow of this program.... Im totally confused and the answer is 7
Creativity is nothing but Breaking Rules
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
Oct 27, 2009 07:51:16
0
Pretend you're the computer: the flow is linear--see if you can work it out yourself.
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Please tell me the program flow..
Similar Threads
How the Interface works ?
Can't understand the Output
Why public?
Cyclic class
deadly diamond of death syndrome :)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter