Skip to content
Advertisement

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 main works

how to replace the vowels from a String with other vowels for encryption?

I’m doing an encryption app with 4 different methods of encryption, one of them is a vowel replace, the problem is that is not working and I’m not sure why, this is the vowelReplace class: } this is my interface: public interface StringEncrypter { } and the controller where I handle the input and selection of the encrypters: public class

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 not be modified or changed whereas modifiable

How to pass dependency B to A if B depends upon C but C is created within A?

I have an object A used to replace text sequences in a given Word document. To construct A, the following dependency has to be passed to its constructor: ReplaceBehaviour: an implementation of an abstract Visitor (Design Pattern) used to replace different types of content (e.g., text, images, tables) in the Word document A internally uses ApachePOI to process Word documents.

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 context for the code In

Advertisement