What is the difference between instanceof and isInstance?
1. What is the difference between instanceof and isInstance?
instanceof is used to check to see if an object can be cast into a specified type without throwing a cast class exception. isInstance() determines if the specified object is assignment compatible with the object represented by this Class.
2. Can applets communicate with each other?
Applets may communicate with other applets running in the same virtual machine. If the applets are of the same class, they can communicate via shared static variables.
3. What are wrapper classes? Why do we need wrapper classes?
Java provides specialized classes corresponding to each of the primitive data types. These are called wrapper classes. They are e.g. Integer, Character, Double etc.
4. What are the usages of Java packages?
It helps resolve naming conflicts when different packages have classes with the same names. This also helps you organize files within your project. For example: java.io package do something related to I/O and java.net package do something to do with network and so on.
Post A Comment:
0 comments: