What is the difference between class & structure?



What is the difference between class & structure?..

Answer / Rajani

In C++, a class is a user-defined data type that encapsulates data (fields) and functions (methods). A struct in C++ is also a user-defined data type but it doesn't support any member function by default. In Java, there are no structures; only classes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is the difference between future and callable interface in java?

1 Answers  


What is matcher in java?

1 Answers  


Why do we use regex?

1 Answers  


What is Ideal Design of Class?

2 Answers  


What is string substring?

1 Answers  


What is the full form of jpeg?

1 Answers  


Enlist diffrent types of inheritance supported by java?

1 Answers  


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

1 Answers  


What happens when the main() isn't declared as static?

1 Answers  


What is static binding and where it occurs?

4 Answers  


Does a class inherit the constructors of its superclass in java programming?

1 Answers  


How can you eliminate duplicates?

2 Answers  


Categories