Why is explicit object casting needed?

  In order to assign a superclass object in a variable to a subclass,one needs to do explicit casting. For example:Person person=null; Man man = (Man)person; An automatic casting takes place when we typecast a object in subclass as parent class object. Define Externalizable. Externalizable is coined as an Interface It extends the Serializable Interface. … Read more

Can an inner class be built in an Interface?

Yes,an inner class may be built an Interface. public interface xyz { static int p=0; void m(); class c { c() { int q; System.out.println(“inside”); } public static void main(String c[]) { System.out.println(“inside “); } }; }   In Java, as of my last knowledge update in January 2022, an inner class can be defined … Read more

What is the difference between UNION and UNION ALL?

This deals with SQL. UNION only selects distinct values, UNION ALL selects all values. In the context of Core Java, the terms UNION and UNION ALL are not directly related. Instead, they are typically associated with SQL (Structured Query Language), which is used for database operations. In SQL: UNION: The UNION operator is used to combine … Read more

What is a Left outer join?

This deals with SQL. Left outer join preserves the unmatched rows from the first (left) table, joining them with a NULL row in the shape of the second (right) table. In the context of Core Java, it’s important to note that Java itself is a programming language and does not directly deal with SQL or database … Read more

What is the difference between JAR and WAR files?

JAR files (Java ARchive) allows aggregating many files into one, it is usually used to hold Java classes in a library. WAR files (Web Application aRchive) stores XML, java classes, and JavaServer pages for Web Application purposes. In Java, JAR (Java Archive) and WAR (Web Application Archive) files are both archive file formats, but they … Read more