FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-programming/javaUpdates/src/oops/ClassB.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
/
ClassB.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (37 loc) · 1.5 KB
Breadcrumbs
java-programming
/
javaUpdates
/
src
/
oops
/
ClassB.java
Copy path
File metadata and controls
42 lines (37 loc) · 1.5 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
39
40
41
42
package
oops
;
public
class
ClassB
implements
InterfaceA
{
static
{
System
.
out
.
println
(
"static block"
);
/*
* this is static block which get execute at the time of class loading process*/
}
{
System
.
out
.
println
(
"non static block"
);
//this is non static block which get execute at the time of object loading process
//at the loading time it execute all the initializers first its also non static initializers
//this is an instance block which help me to create instance
System
.
out
.
println
(
this
);
}
public
ClassB
() {
System
.
out
.
println
(
"constructor"
);
// TODO Auto-generated constructor stub
/*
* the work of constructor is load all the non static variables or non static method inside object memory
* new keyword create block of memory inside heap area after that constructor get called.
* first frame created of constructor inside stack area after that it load all the members of object
* constructor is one member of class but we cant call it explicitly it call automatically when we try to create instance of object
* we use constructor along with only new keyword
* every non static member contains its object reference thats why we can use any non-static member inside any non static member*/
}
public
static
void
sta
() {
System
.
out
.
println
(
"static method"
);
}
public
void
sub
(){
System
.
out
.
println
(
"override inside class B"
);
}
public
void
add
() {
System
.
out
.
println
(
"add from class B"
);
sub
();
//InterfaceA.super.add();
}
}
Back
|
FazBrowse Home
|
New Git URL