How to create an object of a class?
Answers
Answered by
1
Answer:
To create an object of Main , specify the class name, followed by the object name, and use the keyword new :
Example. Create an object called " myObj " and print the value of x: public class Main { int x = 5; public static void main(String[] args) { Main myObj = new Main(); System. ...
Explanation:
hope it's help full to you
Similar questions
Political Science,
26 days ago
Social Sciences,
26 days ago
Environmental Sciences,
26 days ago
Math,
1 month ago
Hindi,
9 months ago
English,
9 months ago