FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-programming/javaUpdates/src/oops/ObjectCreation.java at master · 9146887137/java-programming · GitHub
9146887137
/
java-programming
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-programming
/
javaUpdates
/
src
/
oops
/
ObjectCreation.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (32 loc) · 1.32 KB
Breadcrumbs
java-programming
/
javaUpdates
/
src
/
oops
/
ObjectCreation.java
Copy path
File metadata and controls
38 lines (32 loc) · 1.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
oops
;
public
class
ObjectCreation
{
int
a
=
10
;
//non static initiqalizers which load inside object in heap area at the time of object loadig process
int
b
;
static
int
c
=
30
;
//static inoitializers which load at the the time of class loading process
public
ObjectCreation
() {
// TODO Auto-generated constructor stub
//this non argument constructor
super
();
//when we add no empty super call it call to object class constructor
}
public
ObjectCreation
(
int
a
,
int
b
) {
this
();
//this call statement is used to achieve constructor chaining between same class.
//we use this call or super call at a time not both at same time
this
.
a
=
a
;
this
.
b
=
b
;
//this is no-static reference variable which hold the reference of current object which is in currently execution
//basically we use this at the time when local and global variable of same name and in-order to refer the object member.
//this keyword hold the reference from every context which belong to same object.
//this parameterized constructor which is used to load all the non static members of class inside object memory created in heap area
}
@
Override
public
String
toString
() {
return
"ObjectCreation [a="
+
a
+
", b="
+
b
+
"]"
;
}
public
void
display
() {
System
.
out
.
println
(
"from super"
);
}
}
Back
|
FazBrowse Home
|
New Git URL