-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro3.html
More file actions
89 lines (62 loc) · 3.31 KB
/
intro3.html
File metadata and controls
89 lines (62 loc) · 3.31 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
<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="200" 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">Classes and Objects</font></center>
<font face="Times New Romance" size="4">
Classes create objects and objects use methods to communicate between them. They provide a convenient method
for packaging a group of logically related data items and functions that work on them.
A class essentially serves as a template for an object and behaves like a basic data type “int”. It is
therefore important to understand how the fields and methods are defined in a class and how they
are used to build a Java program that incorporates the basic OO concepts such as encapsulation,
inheritance, and polymorphism.
A class is a collection of fields (data) and methods (procedure or function) that
operate on that data.<br><br>
<b>Example</b><br>
<a href="J.html">Class student has fields as student number and name. This class also maintains two methods as
setData() and display(). The setData() which sets number and name of a student. The display()
displays number and name of a student. Write a java program to set and display number, name
of one student.</a>
<b>Example</b><br>
<a href="K.html">(pass value) Class student has fields as student number and name. This class also maintains
two methods as setData() and display(). The setData() which sets number and name of a student.
The display() displays number and name of a student. Write a java program to set and
display number, name of two student.</a>
<b>Example</b><br>
<a href="L.html">Class Bill has fields as unit price and quantity. This class include methods setBill(),
findBill() and displayBill(). The stBill() set unit price and quantity. The findBill()
calculates bill amount and display() display it. Write a java programe to set,find
and display one bill.</a>
<b>Example</b><br>
<a href="M.html">Rewrite above program using a constructor instead of method setData.</a><br><br>
</font>
</td>
<td align="right" valign="top">
.<br><br><br><br><br><br>
<img src="image/images.jpg" width="300" height="450">
</td>
</tr>
</table>
</body>
</html>