marshal


{ City } chennai
< Country > india
* Profession * it
User No # 4247
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 61
Users Marked my Answers as Wrong # 20
Questions / { marshal }
Questions Answers Category Views Company eMail




Answers / { marshal }

Question { 8238 }

Write a program to create a binary Tree ?


Answer

public class BinaryTree
extends AbstractTree
{
protected Object key;
protected BinaryTree left;
protected BinaryTree right;

public BinaryTree (
Object key, BinaryTree left, BinaryTree right)
{
this.key = key;
this.left = left;
this.right = right;
}

public BinaryTree ()
{ this (null, null, null); }

public BinaryTree (Object key)
{ this (key, new BinaryTree (), new BinaryTree()); }
// ...
}

Is This Answer Correct ?    7 Yes 12 No

Question { 15259 }

What is the use of Getters and Setters method ?


Answer

Before get into the answer, we gotta know something
prior...! "JavaBeans".
JavaBeans are java classes that have properties. For our
purpose, think of properties as private instance variables.
since they're private, the only way they can be accessed
from outside of their class is through 'methods'in the
class.
The methods that change a propertiy's value are called
setter methods, and the methods that retrieve a property's
value are called getter methods.


Is This Answer Correct ?    54 Yes 8 No