-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro4.html
More file actions
111 lines (81 loc) · 4.75 KB
/
intro4.html
File metadata and controls
111 lines (81 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<link type="text/css" rel="stylesheet" href="example.css"></link>
</head>
<body bgcolor="" >
<ul id="u1">
<li id="l1"><a class="ac" href="Home.html" id="a1"><b>Home</b></a></li>
<li id="l1"><a href="AboutUs.html" id="a2"><b>About Us</b></a></li>
<li id="l1"><a href="#contact" id="a2"><b>History of Java</b></a></li>
<li id="l1"><a href="#about" id="a2"><b>Objectives</b></a></li>
</ul>
<table>
<tr>
<td align="left" valign="top">
<a href="intro.html"><img src="image/jj.jpg" width="150" height="150"></a><br>
<a href="intro2.html"><img src="image/j2.jpg" width="150" height="150"></a><br>
<a href="intro8.html"><img src="image/j3.jpg" width="150" height="150"></a><br>
<a href="intro3.html"><img src="image/j4.jpg" width="150" height="150"></a><br>
<a href="intro4.html"><img src="image/j5.jpg" width="150" height="150"></a><br>
<a href="intro5.html"><img src="image/j6.jpg" width="150" height="150"></a><br>
<a href="intro6.html"><img src="image/j7.jpg" width="150" height="150"></a><br>
<a href="intro7.html"><img src="image/j8.jpg" width="150" height="150"></a><br>
</td>
<td align="left" valign="top">
<pre>
<center><font face="Times New Romance" size="8" color="blue">What is Method Overloading</font></center>
<font face="Times New Roman" size="4">
Method Overloading is a feature that allows a class to have two or more methods having same name, if their argument
lists are different.
Method overloading is also known as Static Polymorphism.
Points to Note:
1. Static Polymorphism is also known as compile time binding or early binding.
2. Static binding happens at compile time. Method overloading is an example of
static binding where binding of method call to its definition happens at Compile time.<br>
<b>Example</b>
<a href="N.html">Class calculation has three method used same name add. Write a java application to execute three methods for
one calculation.
First method : receive and add two integer numbers
Second method : receive and add three double numbers
Third method : receive and add two numbers which one is integer other one is double</a>
<b>Example</b>
<a href="Q.html">Class item has item number, item price, available quantity and totalvalue. The class maintain two methods
findTotalvalue() and display. The findTotalvalue() calculate the total value of item. The display() display total value
of an item. Use constructor to set value for number, price and quantity available. Assume display() is a nesting method.
Total value=prince*quantity available
</a>
<center><font face="Times New Romance" size="8" color="blue">What is Inheritance</font></center>
Inheritance is one of the feature of Object-Oriented Programming (OOPs).Inheritance allows a class to use the
properties and methods of another class. In other words, the derived class inherits the states and behaviors
from the base class. The derived class is also called subclass and the base class is also known as super-class.
The derived class can add its own additional variables and methods. These additional variable and methods
differentiates the derived class from the base class.Inheritance is a compile-time mechanism. A super-class
can have any number of subclasses. But a subclass can have only one superclass. This is because Java does not
support multiple inheritance.The superclass and subclass have “is-a” relationship between them.
<b>Example</b>
<a href="R.html">Class student has a method display which display message as "I am student".
Class partTimeStudent also needs to display message as "I am student". Write a
java programe to display as "I am student" for one PartTimeStudent.
</a>
<b>Example</b>
<a href="T.html">Class Employee has fields employee number, employee name and a method setBasicData()
which sets number and name of an employee. Class ContractEmployee has fields as hours worked, and hour
charge. Class also has methods setPaymentData() which sets hours worked and hour charge and
findPayment() which calculate and find payment of employee. Write a java program to set basic data,
set payment data and find payment of a contract employee.
</a>
<b>Example</b>
<a href="U.html">Class Book has fields’ book id and name. Class Storybook has a field price and a method
display which displays id, name and price of a book.Write a java program to set and display data of a story book
</a>
</font>
</td>
<td align="right" valign="top">
.<br><br><br><br><br><br>
<img src="image/bb.jpg" width="250" height="300"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<img src="image/The-Roberts-Partnership-Inheritance-Tax-Planning.png" width="250" height="300">
</td>
</tr>
</table>
</body>
</html>