Professional Documents
Culture Documents
Protectsoft Important Questions and Ans
Protectsoft Important Questions and Ans
ans -> def -> i)it is type of HAS-A Relationship where one object will be depends
on another object
that means if we make any changes in one object it will be affect for
another
object is known as composition.
}
2) public class Customer
{
public interface List
{
void add();
}
}
public class demo extends Customer.List
{
}
5)Difference Stack and Queue in DSA and what are applications ?
6)What are the Advantages and Disadvantages of an Collection Framework in Java ?
ans -> Advantages of an Collections Framework :
a)Provides Unified Architecture b) Reusable in Nature c) easy to
use/perform
d)provides good performance e)provides Type safety with generics
f)provides extensibility g)provides standardization
}
Un-Boxing : i)converting wrapper class object back to primitive value by using
value method
is known unboxing .
i)to perform un-boxing we need perform boxing first.
Program to understand Un-Boxing in Java :
----------------------------------------------
public class Program
{
public static void main(String [] args)
{
int x = 10; // 10 is integer primitive format
System.out.println(x); // primitive
Integer i =x; // auto-boxing
System.out.println(i); // wrapper class object value
// un-boxing
int x1 = i.intValue();
}
}
note : value() methods are available for all primitives.
@Override
public Component createComponent() {
return new TextBox(validator);
}
}
emailTextBox.render();