Answer the question
In order to leave comments, you need to log in
Are types derived from classes?
How are types formed? Explain, please
Answer the question
In order to leave comments, you need to log in
Something like this
This is if the position of the characters A and C does not matter. In general, you can get by with strpos () - regular expressions work slower
A class is one of the varieties of a type; in addition to classes, there are structures, interfaces, and base types, such as int.
In Java and most languages it will give a compilation error, in some (interpreted) languages it will give a runtime error, or the IDE will indicate an error.
no, Java is not supposed to collect this and should say that the `Person` class was not found,
looked for a description in the book, but did not find it. I will describe myself. there's a deeper question here,
you're right - you have a type on the left, and you use a class on the right. in the case of a class that does not inherit from anything and does not inherit anything from it, this is the class.
Let's further imagine that you have two classes Person and Worker. while Worker is inherited from Person. you can safely write the following:
Person personFoo = new Person();
Person personBar = new Worker();
Worker workerBeez = new Worker();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question