0% found this document useful (0 votes)
9 views2 pages

Programming in JAVA-Assignment 2

This document outlines an assignment on programming in Java. It includes 6 questions on topics like JDBC, applets, APIs, inheritance, threading, and namespaces. The questions cover concepts from different areas of Java and range from 2-3 marks each, for a total of 15 marks.

Uploaded by

Rishi Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Programming in JAVA-Assignment 2

This document outlines an assignment on programming in Java. It includes 6 questions on topics like JDBC, applets, APIs, inheritance, threading, and namespaces. The questions cover concepts from different areas of Java and range from 2-3 marks each, for a total of 15 marks.

Uploaded by

Rishi Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming in JAVA

CIC -212

Assignment 2

Total Marks: 15

S.No 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(){
System.out.println(“InBase::foo()”);
}
static void bar(){
System.out.println(“InBar::bar()”);
}
}

classDerivedextendsBase
{
voidfoo(){
System.out.println(“InDerived::foo()”);
}
static void bar()
{
System.out.println(“InDerived::bar()”);
}
publicstaticvoidmain(String[]args)
{
Derivedd=newDerived();
d.foo();d.bar();
((Base)d).foo();
((Base)d).bar();
}
}
(2) classNamespace
{
privateStringmember;
publicStringmember()
{
return member;
}
publicvoidmember(Stringvalue)
{
member=value;
}

publicstaticvoidmain(String[]args)
{
Namespace nm= new Namespace();
nm.member(“name”);
System.out.println(nm.member()+nm.member);
}
}

You might also like