+ 5

How to declare and define objects with variables of different datatypes in C and Java ?

Assigning , retrieving, manipulating, deleting, sorting, .....

25th Dec 2019, 3:03 PM
Shashank Reddy Voorelli
Shashank Reddy Voorelli - avatar
3 Answers
+ 1
First of all you cannot do that in C. In Java you can start by creating a class and declare all types of variables inside. Then in the main() create an object of that class and perform the required operations.
25th Dec 2019, 4:25 PM
Avinesh
Avinesh - avatar
+ 1
C is not an object-oriented language, so you're unable to declare objects using C. In Java, however, you can do that by following the steps below. 1. Create a class. 2. Declare all types of variables inside. 3. Create an object of that class and perform the required operations in the main().
7th Nov 2020, 12:17 AM
amaIeltayib
0
JavaGoal.com You missed a "not" in your first line so kindly make changes.
26th Dec 2019, 6:22 AM
Avinesh
Avinesh - avatar