what is difference between class and object?
Answer Posted / renjith
The terms ‘class’ and ‘object’ are absolutely related to one another, but each term holds its own distinct meaning.
The term ‘class’ refers to the actual written piece of code in which the class is defined. The properties of a class
do not change before, during, or after the execution of a program.
The term ‘object’, however refers to an actual instance of a class. Every object must
belong to a class. Objects are created and eventually destroyed – so they only live in the program for a limited time. While objects are ‘living’ their properties may also be changed signficantly.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the types of web technologies?
What is canonical name in java?
Explain about serializable interface in java?
What are the super most classes for all the streams?
What are the different approaches to implement a function to generate a random number?
Can a class extend 2 classes in java?
How do you sort a list in java?
What is the difference between array and array list in java?
What are desktop procedures?
Can we define private and protected modifiers for the members in interfaces?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
What does exclamation mean in java?
What are the advantages of passing this into a method instead of the current class object itself?
Can we overload the methods by making them static?
explain local datetime api in java8?