Author: Kigul Akit
Country: Poland
Language: English (Spanish)
Genre: Education
Published (Last): 17 September 2007
Pages: 373
PDF File Size: 13.25 Mb
ePub File Size: 2.64 Mb
ISBN: 112-8-31273-954-1
Downloads: 81825
Price: Free* [*Free Regsitration Required]
Uploader: Meziktilar

No, Java class main method can have only void return type for the program to get successfully executed.

What are the two environment variables that must be set in order to run any Java programs? Can a private member of classA can be accessed by an object of classB? This is to avoid spam subscriptions. Using clone, we create copies with the actual state of an object. Which method is to get invoked will depend upon the parameters passed. When a class is declares as final,it cannot be subclassed.

How objects of a class are created if no constructor is defined in the class? I want to persist data of objects for later use. Java provides a default no argument constructor if no explicit constructor is defined in a Java class.

Core Java Interview Questions And Answers For Freshers PDF Free Download

After intsrview of this string object, all built-in methods of String class can be used on the string object. ORG is responsive and optimized web portal for individuals to get preparation for their job interviews, learning and training.

If we use String in such a case, for every data change core java basic interview questions and answers pdf download new String object will be created which will be an extra overhead. When a lot of changes are required in data, which one should be a preference to be used?

In Java, package is a collection of classes and interfaces which are bundled together as they are related to each other. When an object is destroyed by a garbage collector, the space allocated to it from the heap is re-allocated to the heap and becomes available for any new objects.

If there is a hierarchy of inheritance used, a class can be a super class for another class and a sub-class for another one at the same time.

There are three types of loops in Java:. In java, to convert an object into byte stream by serialization, an interface with the name Serializable is implemented by the class. When a new value is assigned to it, a new String object gets created and the reference is moved to the new object.

Download Core Java Interview Questions & Answers PDF:

Constructor is called automatically when we create an object using new keyword. A singleton class in java can have only one instance and hence all its methods and variables belong to just one instance. Which constructor gets used for object creation depends on the arguments passed while creating the objects. Since for both classes, there are no objects created so no memory is allocated on heap for any class. Define what are the two environment variables that must be set in order to run any Java programs?

Is it correct to say that due to garbage collection feature in Java, a java program never goes out of memory? In the below example when counter reaches 4, loop jumps tonext iteration and any statements after the continue keyword are skipped for current iteration.

Stack and Queue both are used as placeholder for a collection of data. Float is single precision floating point decimal number while Double is double precision decimal number.

Since for both classes, there core java basic interview questions and answers pdf download no objects created so core java basic interview questions and answers pdf download memory is allocated on heap for any class. For loops are used in java to execute statements repeatedly for a given number of times.

Core Java Interview Questions And Answers For Freshers PDF Free Download

Core java basic interview questions and answers pdf download a local variable as static gives compilation error. You have not finished your quiz.

Hasic exception thrown from try block needs to be either caught in the catch block or else any specific tasks to be performed before code abortion are put in the Finally block. Please visit using a browser with javascript enabled.

An anonymous class is a class defined without any name in a single line of code using new keyword. The basic condition of method overriding is that method name, arguments as well as return type must he exactly same as is that of the method being overridden.

There is no way to reference it again.

Use of packages helps developers to modularize the code and group the code for proper re-use. Can an interface contain static methods. An array groups data of same primitive type and is static in nature while vectors are dynamic in nature and can hold data of different data types.

If so how can it be implemented by a class since static methods cannot be overridden?