+ 4
Define an object with an example??
9 Answers
+ 13
So, let me explain it with the help of an example, suppose rose is an object of class flower so here's the syntax of creating an object : < Class name > < Object name > = new < Class name > ( );
So here it is :-
flower rose = new flower ( );
So,
flower rose = new flower ( );
| | | |
Class object. Operator constructor
So here the new keyword is used to allocate space in the dynamic memory for the storage of data and functions belonging to an object.
I hope it's clear to you nowđ
+ 11
https://www.sololearn.com/discuss/1043052/?ref=app
//Example
public class AryaDeep{
int b=60;
public static void main(String[] args) {
AryaDeep o = new AryaDeep();
System.out.println(o.b);
}
}
https://www.w3schools.com/java/java_classes.asp
+ 5
Arya Deep Chowdhury Yes bro it will be o
0
Nilesh, bro it will be System.out.println(o.b);
0
~ swim ~ , Yep!, you are right but u didn't got me actually I am looking for kind of definition.
0
~ swim ~ yes its given there