Java Interview Questions And Answers Pdf Yes, We can execute any A package statement must appear as the first line in a source code file. QUESTIONS AND ANSWERS . Core java Interview questions on Coding Standards. . 40) Can we have more than one package statement in source file ?. Dear readers, these Java Interview Questions have been designed especially the subject and later they continue based on further discussion and what you answer − It's compiler generates an architecture-neutral object file format, which.
|Language:||English, Spanish, French|
|Distribution:||Free* [*Registration Required]|
Java Interview Questions .. transmitted, in any form or by any means (electronic, mechanical, into a bytecode file, which is executed by the JVM. Java was. interview questions. Some of the key highlights of java interview questions and answers PDF are: . Fill the subscribe form in the sidebar. Reply. Moin says. Frequently asked Java Interview Questions with detailed answers and examples. server negotiated on the language and format of the content to be shared.
Pls send the interview besed question in my email. I want to a java-interview-questions-and-answers pdf thanks. Hii sir, Plz send me the Ebook of java interview questions. Please send me interview questions and answers ebook. Please send me core Java interview questions to my email. Please send me ebook i have not got ebook on email. Hi sir plz send me java question answer with example in PDF. You should get it in email as soon as you will subscribe to newsletter. Please send the book.
Your initiative is very much useful to us. I appreciate you so much. Thanks a lot!
Please send me copy of Java interview questions pdf. I am following this website and it is very helpful for interviews. Hi Please send me the ebook for Java interview questions pdf Anil. Please send me, I have already subscribe the page. Thanks gandharav katyal. Please send me the interview questions pdf ebook.
Please Send me this ebook…java interview questions. Please send me the latest FAQ questions with answers. Hi sir, i subscribed to your newsletter so request you to send me this book.
I have so many doubts can you clarify my doubts in Java. Hi Pankaj, Where can I subscribe to your newsletter? Im subscribing for the book.. Great contents. Could you please send me the book. Leave a Reply Cancel reply Your email address will not be published. I am a Software Developer just like you and hate spamming. Ans: break and continue are two important keywords used in Loops.
When a break keyword is used in a loop, loop is broken instantly while when continue keyword is used, current iteration is broken and loop continues with next iteration. In below example, Loop is broken when counter reaches 4. What is the difference between double and float variables in Java? Ans: In java, float takes 4 bytes in memory while Double takes 8 bytes in memory. Float is single precision floating point decimal number while Double is double precision decimal number.
What is Final Keyword in Java? Give an example. Ans: In java, a constant is declared using the keyword Final. Value can be assigned only once and after assignment, value of a constant can't be changed. This method are faster than any other method,because they are resolved at complied time. When a class is declares as final,it cannot be subclassed. Example String,Integer and other wrapper classes.
What is ternary operator? Ans: Ternary operator , also called conditional operator is used to decide which value to assign to a variable based on a Boolean value evaluation. It's denoted as?
In the below example, if rank is 1, status is assigned a value of "Done" else "Pending". Ans: Using Math. What is default switch case? Give example. Ans: In a switch statement, default case is executed when no other switch condition matches. Default case is an optional case. It can be declared only once all other switch cases have been coded. In the below example, when score is not 1 or 2, default case is used. What's the base class in Java from which all classes are derived?
Ans: java. Can main method in Java can return any data? Ans: In java, main method can't return any data and hence, it's always declared with a void return type. What are Java Packages? What's the significance of packages?
Ans: In Java, package is a collection of classes and interfaces which are bundled together as they are related to each other. Use of packages helps developers to modularize the code and group the code for proper re-use. Once code has been packaged in Packages, it can be imported in other classes and used.
Can we declare a class as Abstract without having any abstract method? Ans: Yes we can create an abstract class by using abstract keyword before class name even if it doesn't have any abstract method.
However, if a class has even one abstract method, it must be declared as abstract otherwise it will give an error. What's the difference between an Abstract Class and Interface in Java?
Ans: The primary difference between an abstract class and interface is that an interface can only possess declaration of public static methods with no concrete implementation while an abstract class can have members with any access specifiers public, private etc with or without concrete implementation.
Another key difference in the use of abstract classes and interfaces is that a class which implements an interface must implement all the methods of the interface while a class which inherits from an abstract class doesn't require implementation of all the methods of its super class. A class can implement multiple interfaces but it can extend only one abstract class.
What are the performance implications of Interfaces over abstract classes? Ans: Interfaces are slower in performance as compared to abstract classes as extra indirections are required for interfaces. Another key factor for developers to take into consideration is that any class can extend only one abstract class while a class can implement many interfaces.
Use of interfaces also puts an extra burden on the developers as any time an interface is implemented in a class; developer is forced to implement each and every method of interface.
Does Importing a package imports its sub-packages as well in Java? Ans: In java, when a package is imported, its sub-packages aren't imported and developer needs to import them separately if required. For example, if a developer imports a package university. To load the classes from its sub-package say department , developer has to import it explicitly as follows: Import university. Can we declare the main method of our class as private?
Ans: In java, main method must be public static in order to run any application correctly. If main method is declared as private, developer won't get any compilation error however, it will not get executed and will give a runtime error. How can we pass argument to a function by reference instead of pass by value? Ans: In java, we can pass argument to a function only by value and not by reference. How an object is serialized in java?
Ans: In java, to convert an object into byte stream by serialization, an interface with the name Serializable is implemented by the class. All objects of a class implementing serializable interface get serialized and their state is saved in byte stream. When we should use serialization? Ans: Serialization is used when data needs to be transmitted over the network.
Using serialization, object's state is saved and converted into byte stream. The byte stream is transferred over the network and the object is re-created at destination. Ans: Try block needs to be followed by either Catch block or Finally block or both. Any 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. Differentiate between Iterator and Enumeration?
Enumeration is an object that generates elements one at a time. Used for passing through a collection for unknown size. Uses 3 methods to interface such as: It is used for passing through a collection, usually of unknown size.
Iterator method names have been improved. The traversing of elements can only be done once per creation.
Difference between the Inner Class and Sub Class. Inner class provides the access rights for the class which is nesting it and that can access all variables and methods defined in the outer class. Sub-class provides access to all public and protected methods and fields of its super class.
Can we execute any code, even before the main method? How can we restrict inheritance for a class? We can restrict inheritance for class by following steps. Java doesn't support multiple inheritance. Are constructors inherited? Can a subclass call the parent's class constructor?
Define JSON? Easy to parse and conversion to objects for information consumption. Name the methods of Object Class?
Define content negotiation? Will the JVM load the package twice at runtime? Define Abstract class? This class can have public, private, protected or constants and default variables. It needs to be extended and its method implemented. It cannot be instantiated. If a class has at least one abstract method, then the class must be declared abstract. Describe the Annotations. Java Annotations is a tag which symbolizes metadata associated with class, interface, methods, fields, etc.
Annotations do not directly influence the operations. The additional information carried by annotations are utilized by java compiler and JVM. Java doesn't use pointers. Distinguish between static loading and dynamic class loading? Define an enumeration? How can we find the actual size of an object on the heap?
In Java, there is no way to find out the actual size of an object on the heap. Which API is provided by Java for operations on a set of objects? Why we used Vector class?
What is the difference between transient and volatile variable in Java? Mention the uses of Synchronized block.
The scope of synchronized block is smaller than the method. What are the functions of hashCode method? What is the default size of load factor in hashing based collection? Custom tags can manipulate JSP content, but beans cannot. Composite operations can be reduced to a considerably simpler form with custom tags than with beans. Custom tags require reasonably a bit more work to set up than do beans.
Custom tags are available only in JSP 1. What are implicit objects? Define a cookie and what are the difference between session and cookie? The difference between cookies and sessions are: The session is working, regardless of the settings on the client browser.
The client may have selected to disable cookies.
The session and cookies also differ in storing the amount of information. What is a function of IOC container in spring? IOC container is responsible to: What is lazy loading in hibernate? How can we fetch records by spring JdbcTemplate? There are two interfaces to do this: What is the front controller class of Spring MVC? What are the states of an object in hibernate? The states of an object in hibernate are- Transient: When objects are just created having no primary key are in transient state.
Here the objects are associated with any session. When the session of an object is just opened and its instance is just saved or retrieved, it is said to be in persistent state. When the session of an object is closed, it is said to be in detached state.
How to make an immutable class in hibernate? What is hash-collision in Hashtable? How was it handled in Java? Write a syntax to convert a given Collection to SynchronizedCollection?
Write a code to make Collections readOnly? We can make the Collection readOnly by using the following lines code: What is meant by binding in RMI? What are latest features introduced with Java 8?
Self Paced. Learn More. Online Classroom. Browse all courses. Paschal Ositadima Career-oriented Training. John Chioles Good Experience. October 8, at 2: Log in to Reply. Moderator says: October 10, at Sandeep says: September 9, at Patel says: September 7, at 2: John says: