Professional Documents
Culture Documents
Raja Balwant Singh College, Agra: Session 2019-20
Raja Balwant Singh College, Agra: Session 2019-20
Assignment
Of
Java Programming And
Dynamic Webpage Design
Submitted To:
Mr. Vivek Sir Submitted By:
Utkarsh Jindal
BCA 5th Sem.
Page |2
Acknowledgement
I would like to express my special thanks of
gratitude to my teacher Mr. VIVEK SIR who
gave me the golden opportunity to do this
wonderful project on the topic Java
Programming And Dynamic Webpage
Design, which also helped me in doing a lot of
Research and i came to know about so many new
things I am really thankful to them.
Secondly i would also like to thank my parents
and friends who helped me a lot in finalizing this
project within the limited time frame.
Page |3
INDEX
PROGRAM PAGE NO.
Addition of two no. 4
Demonstration of Wrapper Class 5
Demonstrate For Each Loop 6
Check a no. is prime or not 7
Demonstrate Anonymous Object 9
Show all type of Constructor 10
Demonstrate Static variable and static method 11
Demonstrate the use of this keyword 13
Demonstrate Inheritance 14
Demonstrate method Overloading 16
Demonstrate method Overriding 17
Demonstrate the use of super keyword 18
Show the use of abstract class 19
Show the use of interface 20
Show the use of package 21
Demonstrate Exception handling 22
Show the use of thread 23
Demonstrate list in HTML 24
Demonstrate frames in HTML 25
Demonstrate tables in HTML 26
Demonstrate Applet 28
Page |4
class Add
int a, b;
a = in.nextInt();
b = in.nextInt();
Output:
Page |5
int a=75;
//Example of Autoboxing
Integer i=Integer.valueOf(a);
Integer j=a;
Output:
Page |6
System.out.println(name);
Output:
Page |7
class PrimeNumber
int temp;
boolean isPrime=true;
int num=scan.nextInt();
scan.close();
for(int i=2;i<=num/2;i++)
temp=num%i;
if(temp==0)
isPrime=false;
break;
if(isPrime)
else
Output:
Page |9
System.out.println(new AnonymousObject().add(52,94));
Output:
P a g e | 10
ConstructorsExample()
ConstructorsExample(float a, float b)
{
System.out.println("Parameterized Constructor");
System.out.println("Sum :"+(a+b));
}
public static void main(String[] args)
Output:
P a g e | 11
String name;
int rollNo;
this.name = name;
this.rollNo = setRollNo();
counter++;
return counter;
ColgName = name ;
void getStudentInfo(){
Student.setColg("RBS");
s1.getStudentInfo();
s2.getStudentInfo();
Output:
P a g e | 13
int example;
MyClass(int example){
this.example = example;
Output:
P a g e | 14
AClass()
System.out.println("Class--A");
BClass()
System.out.println("Class--B");
CClass()
System.out.println("Class--C");
}
P a g e | 15
Inheritance()
System.out.println("Inheritance");
Output:
P a g e | 16
}Output:
P a g e | 17
Output:
P a g e | 18
Output:
P a g e | 19
Output:
P a g e | 20
class InterfaceExample {
r1.getArea(7,4);
Output:
P a g e | 21
Output:
P a g e | 22
try {
catch (ArrayIndexOutOfBoundsException e) {
Output:
P a g e | 23
System.out.println("Thread is running...");
t.start();
Output:
P a g e | 24
Output:
P a g e | 25
Output:
P a g e | 26
<html>
<head>
</head>
<body>
<tr>
<th>Roll No.</th>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>101</td>
<td>Raman</td>
<td>76</td>
</tr>
<tr>
<td>102</td>
<td>Dhruv</td>
<td>61</td>
P a g e | 27
</tr>
<tr>
<td>103</td>
<td>Utkarsh</td>
<td>85</td>
</tr>
</table>
</body>
</html>
Output:
P a g e | 28
import java.awt.Graphics;
@Override
//html file
<html>
<head>
<title>Applet Demo</title>
</head>
<body>
</applet>
</body>
P a g e | 29
</html>
Output: