core java and advanced java interview questions pdf

Core Java And Advanced Java Interview Questions Pdf

File Name: core java and advanced java interview questions .zip
Size: 22926Kb
Published: 16.12.2020

It's a no-brainer that Java is one of the leading programming options for bagging a lucrative job.

Have a planned interview in the coming days? Start from these basic core java questions. I have written these tutorials specifically for helping you in answering some of the difficult questions you may face. I have tried to put as much reasoning as possible behind each answer. Still, it is not possible to include every possible question in this guide, so I have included some good resources at the end of this interview guide.

Top 100 Java Interview Questions and Answers (Download PDF)

Advanced Java Interview Questions are very important, especially, for experienced java developers. In addition to reading the questions, we recommend watching these two interview preparation videos covering important core java questions.

Variable Arguments allow calling a method with different number of parameters. Consider the example method sum below. This sum method can be called with 1 int parameter or 2 int parameters or more int parameters. Assertions are introduced in Java 1. They enable you to validate assumptions. If an assert fails i. Basic assert is shown in the example below. Assertions should not be used to validate input data to a public method or command line argument.

IllegalArgumentException would be a better option. In public method, only use assertions to check for cases which are never supposed to happen. Garbage Collection is a name given to automatic memory management in Java. Aim of Garbage Collection is to Keep as much of heap available free for the program as possible. JVM removes objects on the heap which no longer have references from the heap. An object of the class GregorianCalendar is created on the heap by the first line of the function with one reference variable calendar.

After the function ends execution, the reference variable calendar is no longer valid. Hence, there are no references to the object created in the method. Garbage Collection runs at the whims and fancies of the JVM it isn't as bad as that.

Possible situations when Garbage Collection might run are. JVM might throw an OutOfMemoryException when memory is full and no objects on the heap are eligible for garbage collection. We recommend not to write any code in finalize ;.

This is run only when class is first loaded. Only static variables can be accessed in a static initializer. Even though three instances are created static initializer is run only once. Regular Expressions make parsing, scanning and splitting a string very easy. We will first look at how you can evaluate a regular expressions in Java — using Patter, Matcher and Scanner classes. We will then look into how to write a regular expression.

Tokenizing means splitting a string into several sub strings based on delimiters. For example, delimiter ; splits the string ac;bd;def;e into four sub strings ac, bd, def and e.

Lets now look at adding a few hours to a date object. All date manipulation to date needs to be done by adding milliseconds to the date. For example, if we want to add 6 hour, we convert 6 hours into millseconds. Below examples shows specific code. Calendar class provides easy ways to add or reduce days, months or years from a date. It also provide lot of details about a date which day of the year? Which week of the year?

Calendar class cannot be created by using new Calendar. The best way to get an instance of Calendar class is by using getInstance static method in Calendar. Setting day, month or year on a calendar object is simple. Call the set method with appropriate Constant for Day, Month or Year. Next parameter is the value.

We use the calendar get method. The parameter passed indicates what value we would want to get from the calendar — day or month or year or.. Few examples of the values you can obtain from a calendar are listed below. Download it now! Powered by Bootstrap and Bootstrap Blogger Templates.

Subscribe to: Posts Atom.

Java Interview Questions

What is the right data type to represent a price in Java? Answer: BigDecimal, if memory is not a concern and Performance, is not critical, otherwise double with predefined precision. What is a class in Java? Answer: Java encapsulates the codes in various classes which define new data types. These new data types are used to create objects. What is a JVM?

15 Technical Core Java Interview Questions Answers for Experienced Developers

Download PDF We have compiled the most frequently asked Java Interview Questions and Answers that will help you prepare for the Basic Java interview questions that an interviewer might ask you during your interview. In this list of Basic Java interview questions, we have covered all commonly asked basic and advanced Core Java interview questions with detailed answers to help you clear the job interview. The following list contains important Core Java interview questions for freshers as well as Java interview questions and answers for experienced programmers to help them prepare for the interview. This detailed guide of interview questions for Java Programming will help you to crack your Job interview easily. What is the difference between an Inner Class and a Sub-Class?

Java object is an object that is provided by the execution of an application. When an application is compiled an object of that application is being made. Java application on the other hand is a program that is being written in Java and being read by the Java virtual machine. What is the purpose of garbage collection in Java, and when is it used? The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.

60 Advanced Java Interview Questions

100+ Java Interview Questions You Must Prepare In 2021

There is the list of core Java interview questions. If there is any core Java interview question that has been asked to you, kindly post it in the ask question section. The answers to the Core Java interview questions are short and to the point. The core Java interview questions are categorized in Basics of Java interview questions, OOPs interview questions, String Handling interview questions, Multithreading interview questions, collection interview questions, JDBC interview questions, etc.

Advanced Java Interview Questions are very important, especially, for experienced java developers. In addition to reading the questions, we recommend watching these two interview preparation videos covering important core java questions. Variable Arguments allow calling a method with different number of parameters. Consider the example method sum below. This sum method can be called with 1 int parameter or 2 int parameters or more int parameters. Assertions are introduced in Java 1.


What is JVM? Why is Java called the Platform Independent Programming Language? What are the basic interfaces of Java Collections Framework?


4 comments

Ella L.

In this list of Basic Java interview questions, we have covered all commonly asked basic and advanced Core Java interview questions with.

REPLY

Gallmilreri

This core Java Interview Questions and answers tutorial covers topics like basic and advanced java definitions, Java programming and coding.

REPLY

AntГ­gono S.

The main distinction between fail-fast and fail-safe iterators is whether or not the collection can be modified while it is being iterated.

REPLY

ElaГ­s S.

If there is any core Java interview question that has been asked to you, kindly post it in the ask question section. We assure that you will get here the 90%.

REPLY

Leave a comment

it’s easy to post a comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>