Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Y we create objects in java.y we use constructor in java. what is static variables?

0
Posted

Y we create objects in java.y we use constructor in java. what is static variables?

0

y we create objects in java? This question tells me that you know only the term “JAVA” in java language. Java is all about classes and objects. Classes is some thing like piece of code that has capacity to do every thing but cannot do by itself. You have to create object of that class to get the work done intended by class. Google for classes and object in OOP…there is hell lot a tutorial out there… y we use constructor in java? In any OOP, constructor means that method which initializes classes. How it works is, constructor method get executed automatically when you create object of any class. If a method in a class has same name as class name, that is the constructor method in that class. what is static variables? Well, variables in class are like non physical variable or that doesn’t actually hold memory…when you create object of class, object hold some memory, and it is divided to variables with in object or class. For normal variable each object has their own copy of memory,

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123