Core Java Fresher Interview Questions with Answers

This blog explains about Core Java Fresher Interview Questions with Answers and is given below :


 Mock interview questions:

1.Scanner class:

Scanner class is used for for getting inputs of primitive datatypes and string. Scanner is in the package of java.util.

2.Why pointer concept is neglected in Java:

Pointer concept can also points the memory address of the data. Using (&-ampersand symbol), we can get the address of the data. So, Java neglects the pointer to make the concept of data security.


3.System.out.print-System is a final class from java.lang package and out is an object for Printstream class and Print is a type of Printstream class.

public final class System {

    static PrintStream out;

    static PrintStream err;

    static InputStream in;



public class PrintStream extends FilterOutputStream {

    //out object is inherited from FilterOutputStream class

    public void println() {



4.for vs while loop:

for loop and while loop has its difference in the syntax. While loop (condition-controlled loop) is said to be known for unknown iterations but for loop(counter controlled loop) is known for known iterations.

For reference :,

5.String args[] :

command line arguments  as it is collection of variables in the string format or you can say as passing array of string arguments.

6.static variable vs object:

You can change the variable with the class name but for nonstatic variables you can change only via objects.

For example:

class Test{ static int a=10;int b=5} Test t1=new Test(); Test t2=new Test();

Test.a=6;System.out.print(t1.a); System.out.print(t2.a);-both will print 6 as output.

But t1.b=10; System.out.print(t1.b); System.out.print(t2.b);-t1 will print as 10&t2 as 5.

So, the memory of static will be shared and memory of nonstatic will not be shared and it will be changes with instance.

For reference:


7.break in switch:

Break in switch statement is necessary because it will break the loop when the case of the loop is executed otherwise it will falls through all the cases. In C programming language, it was referenced with Branch table. In C# programming language, it was overcome with jump statement.

For reference:


8.abstract vs interface:

An interface is an implementation of class and differs with interface keyword. An abstract class will extends the behavior of class and differs with abstract keyword. Interface is a keyword used to create interface and it can’t be used with methods whereas abstract is keyword used to create class and can be used with methods.

For reference:, in local variable:

final is a keyword when declared with variables, its value can’t be modified. final keyword can be declared to variables, methods as per our convenience.

For reference:

10.variable in interface:

we can declare variables in java but it will consider it as public static variable since interface doesn’t allow object creation i.e. instances can’t be created so it will have only one memory all over the load of class.

For reference:,,

Only method properties have changed in interface after java 1.8.


  1. Apache maven:

  2. Apache maven is a software project management and comprehension tool. It was developed by apache software foundation.

For reference:,,

                                                                                                                                                                             –          BY