Hello Friends, In this blog post(Core Java Interview Questions), I am going to let you know about a few more interview questions about core java which are related to the program beginning with java. Hope! this information would be very useful for you.
Core java interview questions cover all the important questions of the topics mentioned above.
These core java interview questions are a great help to remember all the important highlights and important topics from each java chapter.
These interview questions will surely help to understand a few very confusing concepts in java.
What is an API document?
An API document is a .html file that contains descriptions of all the features of a software, a product, or a technology. API document is helpful for the user to understand how to use the software or technology.
What is the difference between the #include and import statements?
#include directive makes the compiler go to the C/C++ standard library and copy the code from the header files into the programs. As a result, the program size increases, thus wasting memory and processor’s time.
Import statement makes the JVM go to the java standard library, execute the code there, and substitute the result into the program. Here, no code is copied hence no waste of memory or processor’s time. So, import is an efficient mechanism than #include.
What happens if string args is not written in the main() method?
When the main() method is written without string args as:
public static void main()
The code will compile but JVM cannot run the code because it cannot recognize the main() method as the method from which it should start the execution of the java program. Remember JVM always looks for the main() method with string type array as parameter.
What is the difference between the print() and Println() method?
Both methods are used to display the results on the monitor. The print () method displays the result and then retains the cursor in the same line, next to the end of the result. Println() displays the result and then throws the cursor to the next line.
So this was all about the Core java interview questions on this topic.
These Core java interview questions could be a great help in your college viva, academic study, and any job interview.
In the case of any queries, you can write to us at [email protected] we will get back to you ASAP.
Hope! you would have enjoyed this post about Core Java Interview Questions Part 3/ program beginning with java.
Please feel free to give your important feedback in the comment section below.
Have a great time!