COIS 2240H Lecture Notes - Lecture 9: Compile Time, Type Safety
Document Summary
Inner classes cannot be seen by other classes. **you cannot have a private class in java. Local inner class- can be seen by the parent class, can be private, meaning no other classes can see it. Method local inner classes- they are local to the method. Anonymous inner class does(cid:374)"t have a (cid:374)a(cid:373)e. Onto generics: generics is a relatively new concept for java, the concept of generics existed inmoney programming languages, this is a real insight into how languages grow with time. What are generics: are a programming concept we use in order to be able to a type or a methos to operate on various. It is a placeholder for any type. different type of objects: generics are very important because they provide compile time safety. Generics: types safety: type safety is one of the top reasons that support for generics was added to java but what is it exaaclty, type safety refers to operations not causing undefined errors.