Skip to content

Tag: oop

Java OOP; creating array of objects

I’d like to create an array of objects where 3 objects are from one class, and a 4th is from second class. In the first class I did the following: in the second class I did the following: In the main class, I created several pupil objects and one tutor object, like this: Using objects for printing in ma…

Accessible and Modifiable data?

what is the difference between accessible and modifiable data in the variable grade in terms of accessibility from outside the class? This is my code where i’m calling grade method from outside the class: Answer accessible data means you can only access .we can you only view or access the data it can no…

Adding a newly created object into an array in swift

I decided to start a project in java to get a rough outline of how the program was to function before I started to program it in swift(a language I am completely unfamiliar with) whilst trying to convert the code I’ve ran into an issue and cannot even understand how I’ve gone wrong. This is contex…