Professional Documents
Culture Documents
Name: Saptashwa Banerjee Roll: 13000318064 Sec: A Sub: Web Technology Paper Code: OE-EC704A
Name: Saptashwa Banerjee Roll: 13000318064 Sec: A Sub: Web Technology Paper Code: OE-EC704A
Roll: 13000318064
Sec: A
Sub: Web Technology
Paper code: OE-EC704A
-------------------------------------------------------------------------------------------------------------------------------
Ans 1 :
<html>
<head>
<h2>Course Registration Form</h2>
</head>
<body >
<form>
<b>Name:</b> <input type="text" name="username"><br> <br>
<b>Email:</b> <input type="email" name="email"><br> <br>
<b>Password:</b> <input type="password" name="pwd"/><br> <br>
<b>Gender:</b> <input type="radio" name="gender" value="Male" checkbox/> Male
<input type="radio" name="gender" value="Female" checkbox/> Female <br>
<b>Stream:</b> <input type=checkbox name=subject checkbox/>CSE
<input type=checkbox name=subject checkbox/>ECE
<input type=checkbox name=subject checkbox/>IT<br>
</form>
</body>
</html>
OUTPUT:
Ans 2:
If a class has multiple methods having the same name but different in parameters, it is
known as Method Overloading. There are two ways to overload the method in java:
1. By changing number of arguments
2. By changing the data type
class Subtract{
}
class TestOverloading{
System.out.println(Subtract.sub(9,5));
System.out.println(Subtract.sub(10,5,2));
}}
OUTPUT:
4
3
Ans 3:
class Car{
public Car()
{
System.out.println("Class Car");
}
public void vehicleType()
{
System.out.println("Vehicle Type: Car");
}
}
class Maruti extends Car{
public Maruti()
{
System.out.println("Class Maruti");
}
public void brand()
{
System.out.println("Brand: Maruti");
}
public void speed()
{
System.out.println("Max: 90Kmph");
}
}
public class Maruti800 extends Maruti{
public Maruti800()
{
System.out.println("Maruti Model: 800");
}
public void speed()
{
System.out.println("Max: 80Kmph");
}
public static void main(String args[])
{
Maruti800 obj=new Maruti800();
obj.vehicleType();
obj.brand();
obj.speed();
}
}
OUTPUT:
Class Car
Class Maruti
Maruti Model: 800
Vehicle Type: Car
Brand: Maruti
Max: 70Kmph
Ans 4:
Differentiate between Class and Method with suitable examples.
Class Method
A template for creating objects within a A function that exposes the behaviour of
program an object
Example:
public class Cube {