Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value/call-by reference. (PS : Pls ignore syntax errors)

public class One {
public oneA(){
sop ("Into One--");}
}
public class Two extends One{
public twoT(){
sop ("Into Two--"); }
}
public class Home {
One a; Two t;
public static void main(argv[])
{
sop ("In Home--");
sop(a.oneA());
sop(t.oneA());
sop(a.twoT());
sop(t.twoT());
}
}

Answers were Sorted based on User's Feedback



Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value..

Answer / mohammad aleemuddin

Compilation Error
return type required for the methods..

Is This Answer Correct ?    7 Yes 0 No

Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value..

Answer / jahir

compile time error.

Is This Answer Correct ?    0 Yes 0 No

Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value..

Answer / guest

sorry it ll not give any output as tthere is no object has
been created to call methods of super class

Is This Answer Correct ?    0 Yes 0 No

Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value..

Answer / jitendra

Cannot make a static reference to the non-static field a

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More J2EE Interview Questions

What do you mean by the component contract?

0 Answers  


Give some advantages of orm (object-relational mapping)?

0 Answers  


What is initialization parameter?

0 Answers  


What are the different types of events in java?

0 Answers  


Is advanced java and j2ee same?

0 Answers  






What is event handling in java?

0 Answers  


What are types of j2ee clients?

0 Answers  


Are java primitives objects?

0 Answers  


What is j2ee server?

0 Answers  


What is the concept of connection pooling?

0 Answers  


What is button in java?

0 Answers  


Since we can create managed bean by two ways as, we can define the bean name in faces-config.xml file so that page can use that OR we can write annotation on bean class so that it is automatically assign to page but I want to know which one is good programming practice ? And also mention disadvantage of other which should not prefer ... Thanking you...

0 Answers   ASD Lab,


Categories