Programming in JAVA
CIC -212
Assignment 2
Total Marks: 15
[Link] Questions CO Marks
Q1. Explain JDBC in details? CO4 2
Q2. What are various event and Layouts in Applets? Explain Event Handling in CO3 2
details.
Q3. Explain different usage of APIs in Java ? Give some API interfaces used in JAVA. CO4 2
Q4. Write down the usefulness of Hashtable classes ? CO4 2
Q5. Write a program in Java to follow the following hierarchy using multiple CO2 2
inheritance.
Shape
2D 3D
RectangleSquareCircle Sphere Cube
Q6. Explain Thread Lifecycle. What do you mean by ‘multithreading’ CO3 2
Q7. Determine the output: CO4 3
(1) class Base
{
voidfoo(){
[Link](“InBase::foo()”);
}
static void bar(){
[Link](“InBar::bar()”);
}
}
classDerivedextendsBase
{
voidfoo(){
[Link](“InDerived::foo()”);
}
static void bar()
{
[Link](“InDerived::bar()”);
}
publicstaticvoidmain(String[]args)
{
Derivedd=newDerived();
[Link]();[Link]();
((Base)d).foo();
((Base)d).bar();
}
}
(2) classNamespace
{
privateStringmember;
publicStringmember()
{
return member;
}
publicvoidmember(Stringvalue)
{
member=value;
}
publicstaticvoidmain(String[]args)
{
Namespace nm= new Namespace();
[Link](“name”);
[Link]([Link]()+[Link]);
}
}