Core Java Interview Questions
Introduction Java is a platform independent, case sensitive language which is used to create secure and robust applications. It was developed by James Gosling in 1991. Apart from having a C like notation, it was much easier, uniform and simple than C/C++. The first version of Java was released by Sun Microsystems in 1995. It works on a "Write Once Run Anywhere" platform. Java is open source software. The J2 versions of Java were renamed as Java SE, Java EE, and Java ME. Java is an object-oriented programming language. Java is a combination of the features of C and C++. It has inherited its features from C and object-oriented programming feature from C++.
Explain the significance of class loaders in Bootstrap? In order to load the Java Classes into a virtual environment, Classloader are used. A class loader will load key classes such as java.lang.object and several other codes into the memory. Usually, these classes are loaded only if a demand occurs. Since Java Runtime Environment includes loaders, they need not know about file and file systems. Also, the loaders are responsible for converting the named class into an equivalent binary form.
What are the various access specifiers in Java? Access specifiers in java are the keywords which define the access scope of the function. It can be used before a class or a method. There are basically 4 types of access specifiers in java: – Public: – class, methods, and fields are accessible from anywhere. Protected: – methods and fields are accessed from the same class to which they belong. Even from the subclass and class from the same package. Any outside class cannot access the methods and fields. Default: – only from the same package, the methods and fields be accessed and not from the outside package. Private: – the methods and fields can be only accessed from the same class to which they belong.
Why object class is super class for every class in java? After creating the object JVM internally calls the toString method to generate the indirect address of the object. To string method is present inside object class, which is defined as non-static. So that object class makes it as a superclass for every class in java.
How Thread Scheduler schedule the task? Thread scheduler maintains threading states by using primitive and time slicing scheduling. It schedules the tasks by setting priority and time. Only one thread can run at a time in a single process by thread scheduler. When the highest priority is set to a process, the first process at highest priority gets starts before coming into dead or waiting state, after that the next process in the waiting state comes and make it task done and so on. This is how the thread scheduler schedules the task.
What is early binding and late binding in Java? The process of the connecting function call with function body is called binding. When this binding is done at compile time, it is called early binding. Early binding is static binding it is done when the type of an object is determined at compile time. On the hand, late binding is done at runtime. Late binding is dynamic binding because it is done at runtime by the compiler itself.
Why we use multi threading instead of multiprocessing? The purpose of using multithreading is to make multiple lightweight processes running simultaneously because threads have a plus point, they are lightweight process. Multiple processes not only reserve the memory space but also make the increase the work complication as well. To eliminate the memory space issue and complications we prefer multithreading because they used a shared memory area which saves memory and performs better memory management.
What is early binding and late binding in Java? The process of the connecting function call with function body is called binding. When this binding is done at compile time, it is called early binding. Early binding is static binding it is done when the type of an object is determined at compile time. On the hand, late binding is done at runtime. Late binding is dynamic binding because it is done at runtime by the compiler itself.
What mechanism does Java use for memory management? Java use garbage collection which is performed automatically in Java to free the memory space from unused objects automatically. It is used to identify and dispose those objects that are no longer needed for the application. In other languages like C and C++ you must perform garbage collection by yourself to manage the memory, it means Java provides good memory management.
What do you understand by overloading and overriding in java? When in a program there is more than one method with the same name in a single class but the arguments used in them are different, then such thing is referred to as method overloading. Overriding concept in java means when there are two methods with the same signature, one is in the parent class and the other one is in the child class. The override annotation can be used in the child class overridden method.
Compare java and python. Java and Python, both the languages hold an important place in today’s IT industry. But in some factors, one is better than the other. Such factors are: Java is easy to use, whereas Python is very good in this case. The speed of coding in Java is average, whereas in Python it is excellent. In Java, the data types are statically typed, whereas in python the data types are dynamically typed. Java is average in the case of data sciences and machine learning applications, whereas data science and machine learning applications are majorly based on python. Python is very good in this case.
Thanks for Reading Core Java Interview Questions Also more Read core java interview questions Visit us: www.onlineinterviewquestions.com

Core Java interview questions-ppt

  • 1.
  • 2.
    Introduction Java is aplatform independent, case sensitive language which is used to create secure and robust applications. It was developed by James Gosling in 1991. Apart from having a C like notation, it was much easier, uniform and simple than C/C++. The first version of Java was released by Sun Microsystems in 1995. It works on a "Write Once Run Anywhere" platform. Java is open source software. The J2 versions of Java were renamed as Java SE, Java EE, and Java ME. Java is an object-oriented programming language. Java is a combination of the features of C and C++. It has inherited its features from C and object-oriented programming feature from C++.
  • 3.
    Explain the significanceof class loaders in Bootstrap? In order to load the Java Classes into a virtual environment, Classloader are used. A class loader will load key classes such as java.lang.object and several other codes into the memory. Usually, these classes are loaded only if a demand occurs. Since Java Runtime Environment includes loaders, they need not know about file and file systems. Also, the loaders are responsible for converting the named class into an equivalent binary form.
  • 4.
    What are thevarious access specifiers in Java? Access specifiers in java are the keywords which define the access scope of the function. It can be used before a class or a method. There are basically 4 types of access specifiers in java: – Public: – class, methods, and fields are accessible from anywhere. Protected: – methods and fields are accessed from the same class to which they belong. Even from the subclass and class from the same package. Any outside class cannot access the methods and fields. Default: – only from the same package, the methods and fields be accessed and not from the outside package. Private: – the methods and fields can be only accessed from the same class to which they belong.
  • 5.
    Why object classis super class for every class in java? After creating the object JVM internally calls the toString method to generate the indirect address of the object. To string method is present inside object class, which is defined as non-static. So that object class makes it as a superclass for every class in java.
  • 6.
    How Thread Schedulerschedule the task? Thread scheduler maintains threading states by using primitive and time slicing scheduling. It schedules the tasks by setting priority and time. Only one thread can run at a time in a single process by thread scheduler. When the highest priority is set to a process, the first process at highest priority gets starts before coming into dead or waiting state, after that the next process in the waiting state comes and make it task done and so on. This is how the thread scheduler schedules the task.
  • 7.
    What is earlybinding and late binding in Java? The process of the connecting function call with function body is called binding. When this binding is done at compile time, it is called early binding. Early binding is static binding it is done when the type of an object is determined at compile time. On the hand, late binding is done at runtime. Late binding is dynamic binding because it is done at runtime by the compiler itself.
  • 8.
    Why we usemulti threading instead of multiprocessing? The purpose of using multithreading is to make multiple lightweight processes running simultaneously because threads have a plus point, they are lightweight process. Multiple processes not only reserve the memory space but also make the increase the work complication as well. To eliminate the memory space issue and complications we prefer multithreading because they used a shared memory area which saves memory and performs better memory management.
  • 9.
    What is earlybinding and late binding in Java? The process of the connecting function call with function body is called binding. When this binding is done at compile time, it is called early binding. Early binding is static binding it is done when the type of an object is determined at compile time. On the hand, late binding is done at runtime. Late binding is dynamic binding because it is done at runtime by the compiler itself.
  • 10.
    What mechanism doesJava use for memory management? Java use garbage collection which is performed automatically in Java to free the memory space from unused objects automatically. It is used to identify and dispose those objects that are no longer needed for the application. In other languages like C and C++ you must perform garbage collection by yourself to manage the memory, it means Java provides good memory management.
  • 11.
    What do youunderstand by overloading and overriding in java? When in a program there is more than one method with the same name in a single class but the arguments used in them are different, then such thing is referred to as method overloading. Overriding concept in java means when there are two methods with the same signature, one is in the parent class and the other one is in the child class. The override annotation can be used in the child class overridden method.
  • 12.
    Compare java andpython. Java and Python, both the languages hold an important place in today’s IT industry. But in some factors, one is better than the other. Such factors are: Java is easy to use, whereas Python is very good in this case. The speed of coding in Java is average, whereas in Python it is excellent. In Java, the data types are statically typed, whereas in python the data types are dynamically typed. Java is average in the case of data sciences and machine learning applications, whereas data science and machine learning applications are majorly based on python. Python is very good in this case.
  • 13.
    Thanks for Reading CoreJava Interview Questions Also more Read core java interview questions Visit us: www.onlineinterviewquestions.com