Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

what is instance of objects in java

MatthewXia
MatthewXia

pls help. im struggling. :(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(:(

2 years ago
You are viewing a single comment. View All
2
Coder100
Coder100

instanceof is just to see if an object is created by a class:

class Something { private final int name; Something (int name) { this.name = name; } } class Something2 { private final int name; Something (int name) { this.name = name; } } Something something = new Something(2); Something2 something2 = new Something2(3); something instanceof Something; // true something2 instanceof Something; // false
2 years ago