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 is javac written?

0 Answers  


How does event listener work in java?

0 Answers  


Hi friends can you give me sample code for Entire j2ee web application with struts and hibernate.I mean code for Dao, DaoImpl, HibernateDao ,HibernateDaoImpl, Dto , service , ServiceImpl , i.e.

1 Answers  


What are the components of J2EE application?

0 Answers  


what is data modeling?what is final method

1 Answers   Oracle,






what is jvm? how can it is useful in java?

3 Answers  


Is java good for web development?

1 Answers  


what is transaction?what are the differenr type of transactions

1 Answers   HCL,


What does j2ee stand for?

0 Answers  


Is python more secure than java?

0 Answers  


what is Directory Structure of webapplication?

8 Answers   CTS, Virtusa,


What is the best java application server?

0 Answers  


Categories