I've been programming professionally in the Java Programming language for the past three years, but still there are aspects of my work that seems unfamiliar to me. I would be listing down below some concepts that I wanted to learn more about this OOP language (and if I mentioned something wrong, please do correct me!).
- The purpose of implementing IClusterable and Serializable interfaces in Model objects (and even in forms)
As of now, I still have to research the IClusterable part.
- The differences of using protected, public, private, and default Java classes/methods
This concept is best illustrated by this diagram (credits to this):
Modifier | Class | Package | Subclass | World ————————————+———————+—————————+——————————+——————— public | ✔ | ✔ | ✔ | ✔ ————————————+———————+—————————+——————————+——————— protected | ✔ | ✔ | ✔ | ✘ ————————————+———————+—————————+——————————+——————— no modifier | ✔ | ✔ | ✘ | ✘ ————————————+———————+—————————+——————————+——————— private | ✔ | ✘ | ✘ | ✘
public - visible to any class
no modifier (default) - visible within its own package only
private - visible within its own class only
protected - visible within its own package and to its subclasses in another package
These access level modifiers exist in Java to eliminate misuse of variables in classes.
- What's the difference between a session id and a cookie? (credits to here)
A session is a store of data on the server containing state information on a user. A particular sessions is identified by its session id, ideally a large (i.e. unguessable) random number. For example, the session could hold a user's shopping cart.
A cookie is also a store. To create a cookie, the server sends a HTTP header to the client (i.e. the web browser). If the client supports and accepts the cookie, the cookie will be sent back to the server along with every request made to the server.
Cookies are often used to store a session id, binding the session to the user.
- Implements and Extends declarations, Interface and Abstract classes
Extends means that you are making that class a subclass of that class, inherting all its variables and methods. You can extend one class only.
The difference between an interface and an abstract class is that in an interface, the class that implements it is required to override all the methods of that interface. Meanwhile in implementing an abstract class, you can just override selected methods. Also, an abstract class can be extended, but not instantiated in a class.
- Definition of Objects, and the Foundations of Object-Oriented Programming (OOP) (credits to this)
- What is a class?
- How to make an infinite loop using a for loop:
for ( ; ; ){}
- The Model-View-Controller Architecture Concept
Model - database
View - User Interface
Controller - Logic
- Java Collections Framework: Differences of Set, List, and Map (credits to this)
Set - unordered collection of unique objects (i.e. LinkedHashSet, TreeSet, HashSet)
List - ordered and indexed collection that can contain duplicates (i.e. ArrayList, LinkedList); it also allows null elements
Map - data structure based on key value pairing and hashing; keys must be unique, regardless if they contain duplicate values; it allows at most one null key (i.e. HashMap, HashTable, Treemap)
- Differences of equals and ==
- The essence of synchronization
- Are Strings mutable or immutable?
- Pass-By-Reference and Pass-By-Value
Suddenly, I had this urge to earn a Java certification in the future (is it really worth it though?). I'd work harder from now on.
0 (mga) komento
I would love to hear your thoughts! ✨