Category Archives: Java

Java Object Creation of Inherited Class

In inheritance, subclass acquires super class properties. An important point to note is, when subclass object is created, a separate object of super class object will not be created. Only a subclass object object is created that has super class variables. This situation is different from a normal assumption that a constructor call means an… Read More »

Establishing JDBC Connection in Java

Before establishing a connection between front end i.e your Java Program and back end i.e the database we should learn what precisely a JDBC is and why it came to existence. What is JDBC ? JDBC is an acronym for Java Database Connectivity. It’s an advancement for ODBC ( Open Database Connectivity ). JDBC is… Read More »

Interesting facts about null in Java

Almost all the programming languages are bonded with null. There is hardly a programmer, who is not troubled by null. In Java, null is associated java.lang.NullPointerException. As it is a class in java.lang package, it is called when we try to perform some operations with or without null and sometimes we don’t even know where… Read More »

Java and Multiple Inheritance

Multiple Inheritance is a feature of object oriented concept, where a class can inherit properties of more than one parent class. The problem occurs when there exist methods with same signature in both the super classes and subclass. On calling the method, the compiler cannot determine which class method to be called and even on… Read More »

Method overloading and null error in Java

In Java it is very common to overload methods in Java. Below is an interesting Java program. Output : 22: error: reference to fun is ambiguous mv.fun(null); ^ both method fun(Integer) in Test and method fun(String) in Test match 1 error The reason why we get compile time error in the above scenario is, here… Read More »

Command Line arguments in Java

If we run a Java Program by writing the command “java Hello Geeks At GeeksForGeeks” where the name of the class is “Hello”, then it will run upto Hello. It is command upto “Hello” and after that i.e “Geeks At GeeksForGeeks”, these are command line arguments. When command line arguments are supplied to JVM, JVM… Read More »

How to create Immutable class in Java?

Immutable class means that once an object is created, we cannot change its content. In Java, all the wrapper classes (like String, Boolean, Byte, Short) and String class is immutable. We can create our own immutable class as well. Following are the requirements: • Class must be declared as final (So that child classes can’t… Read More »

Lambda Expressions in Java 8

Lambda expressions basically express instances of functional interfaces (An interface with single abstract method is called functional interface. An example is java.lang.Runnable). lambda expressions implement the only abstract function and therefore implement functional interfaces lambda expressions are added in Java 8 and provide below functionalities. Enable to treat functionality as a method argument, or code… Read More »

Functional Interfaces In Java

A functional interface is an interface that contains only one abstract method. They can have only one functionality to exhibit. From Java 8 onwards, lambda expressions can be used to represent the instance of a functional interface. A functional interface can have any number of default methods. Runnable, ActionListener, Comparable are some of the examples… Read More »

FICO ( Fair Issac and Corporation) | Set 1(On Campus)

On Campus Recruitment only for ” MCA ” There were 3 rounds: Round 1: Written( Offline written test which comprises of 3 modules) Module 1 : Technical Aptitude- Output questions on Java (MCQ) based on recursion,inheritance, matrix,strings etc. Module 2 : General Aptitude– Focus was mainly on PROBABILITY (RD Sharma),last digit of a number,diagonal passing through a grid… Read More »

Default Methods In Java

Before Java 8, interfaces could have only abstract methods. The implementation of these methods has to be provided in a separate class. So, if a new method is to be added in an interface then its implementation code has to be provided in the class implementing the same interface. To overcome this issue, Java 8… Read More »