Java Programming Interview Questions
Java Technical Interview Questions: Learn Java collections interview questions for all technical jobs HR round java interview questions with answers

When to use Scripting languages and when to use Programming languages? When we need to build only UI or logic then we use scripting languages and to build both UI and logic then we use Programming languages.
Programming languages must be compiled whereas Scripting languages may/may not be compiled.
The advantage of the compiled program is it runs faster because the code is already converted into machine code, If there is any error in the code while compiling then it shows Compile time error.
What is a compiler? Why it came in to picture? The computer can only understand binary language ie., in 0s and 1s. To translate the general human readable language into machine understandable language there should be one translator which converts any language into machine readable language.
This compiler is one which translates the entire code at once into machine code. And while translating the entire code into machine code if it finds an unknown format which is not understandable by the compiler while translating into machine code then we get compile time errors.
Every Programming language has to compile time errors but the tools which support building that code may have an interpreter feature so that it minimizes the errors.
What is an interpreter? The code which translates into machine-understandable language line by line is called an interpreter. This means it checks the 1st line of code after translating it into machine-understandable code then it checks into 2nd line of code and translates it into machine-understandable language. Like this, it continues till the end of the code.
How do develop this compiler and interpreter? To develop a compiler and interpreter, we use Programming language. We can make a Programming language into a scripting language by designing an interpreter
Ex: C
Similarly, we can design a compiler for Scripting languages and make it into a Programming language
Ex: v8, which compiles Java Script code into Machine code.
Total How many programming languages are there? We have more than 250 programming languages
The team consist of
James Gosling Mike Sheridan Patrick Naughton They called it as Green talk with an extension of .gt, later they renamed it to OAK and finally to Java in 1995
Why did 'Green Team' change OAK to JAVA? Actually OAK is the symbol of Strength but it was the trademark of 'OAK Technologies'. Since 'OAK' is registered under Trademark, the team thought of a word which relevant 'revolutionary', 'dynamic', 'lovely', 'cool', 'unique', 'fun'. A majority of the people proposed 'Java'. So 'Java' came into the picture. What are the features of Java? 1. Simple 2. Object Oriented 3. Platform independent 4. Secured 5. Robust 6. Dynamic 7. Interpreted 8. High Performance 9. Architecture Neutral 10. Multi-Threaded 11. Distributed 12. Portable 13. Familiar Why Java is Simple? Java is simple because it overcomes the drawbacks of c++ i.e., Java doesn't contain Pointers (means a variable which holds the address of memory location.), Operator Overloading (priority of operators under in logic) and introduced automatic Garbage Collector (which removes unused code from the memory after the program execution). Why Java is Object Oriented? Object-oriented means the combination of data(generally variables which hold values) and the behaviour (the logic which we used) which supports Polymorphism and Inheritance whereas other languages do not. Java useObject Oriented Programming(Oops) concepts of Class Object Inheritance Polymorphism Abstraction Why Java is the Platform independent? Java programs should save with the extension of ".java". Once it is compiled, the source code is converted into Byte code with the extension of ".class" by the compiler. As this ".class" file contains 0s and 1s, which is common in all the operating system(Since all the Operating Systems(UNIX, LINUX, WINDOWS, MAC and etc..) understands 0s and 1s). So Java is platform independent. It uses WORA(Write Once Run Anywhere). Why Java is Secured? Java is secured because no explicit Pointer(which gives the address of memory location) and the Java program runs inside JVM(Java Virtual Machine) and this JVM runs inside JRE(Java Runtime Environment) and this JRE runs inside JDK(Java Development Kit). As the java program is covered by JVM, JRE and JDK, the Java program is secured. Representing diagrammatically as :
Why Java is Robust?
Robust means Strong. Why strong? because it as
1. Strong memory management
2. Automatic garbage collector (means in compile time while storing data into respective memory location, this garbage collector collects all the unused data from the program and cleans it. So that there is no storage of memory for unused data in the memory location)
3. There is exception handling(which means it handles all the exceptions which prevent the stoppage of flow)
4. Type checking mechanism(which states whether all are correct as per the java syntaxes)
Why Java is interpreted?
Since the interpreter converts line-by-line code into byte code, while writing the Java program itself, the java interpreter converts line-by-line code into machine code. If the java interpreter does not understand the code which is not as per Java rules and regulations, then the java interpreter shows a red 'x' mark at that line which may cause due to syntax error or invalid datatype or unknown data etc., It also gives suggestions by mouse over on it.
Ex: Diagrammatically:
----------> For unknown data
------> giving suggestions when mouse over on 'x' mark
----> giving suggestion for invalid datatype when mouse over on 'x' mark
Java Technical interview questions
Q) Did Java is Platform – independent?
Answer: YesQ) Can Java be used in Windows-based, Web – Based, Mobile and Enterprise based applications?
Answer: Yes
Q) Did Java support the “goto” statement as it is in C and C++ languages?
Answer: No
Q) Did Java support multiple inheritances through class?
Answer: YesQ) Did Java support multiple inheritances through the interface?
Answer: Yes
Q) Did Java support Operator Overloading?
Answer: No
Q) Is it possible to write Pointer programs in Java?
Answer: No
Q) Did java internally support the pointer?
Answer: Yes
Q) Did Java have compiler and interpreter features?
Answer: Yes
Q) Did Java support call by value?
Answer: Yes
Q) Did Java support call by reference?
Answer: No
Q) Did Java supports Structures as in C and C++?
Answer: No
Q) Did Java supports Unions as in C and C++?
Answer: No
Q) Did Java support Built-in Thread?
Answer: Yes
Q) Can we use the “virtual” keyword in java to override the methods?
Answer: No, we don’t have the “virtual” keyword in Java to override the methodsQ) Did override is possible in Java?
Answer: Yes, for non-static methodsQ) Can we call non-static methods virtual by default?
Answer: Yes
Q) What is a super-class of any class?
Answer: Ye, java. lang.Object Q) Did Java uses a single inheritance tree?Answer: Yes
Q) Did Java support unsigned right shift (>>>) and unsigned left shift (<<<) operators?
Answer: Yes
Java interview questions for Fresher's experience
Learn More: Part II- Java collections Interview Questions
Related search Java collections interview questions list, java interview questions, java interview questions and answers, core java interview questions, java programming questions, java programming interview questions, java interview programs, java questions and answers, java basic interview questions, advanced java interview questions, java developer interview questions, java coding interview questions, java collections interview questions, java programming interview questions and answers, simple java programs for interview, core java programming interview questions, java technical interview questions, Java collections interview questions online free, list of Java collections interview questions, best Java collections interview questions, technical Java collections interview questions for freshers, Java collections interview questions for experienced, MNC jobs Java collections interview questions careers, important Java collections interview questions experienced, pdf download of Java collections interview questions freshers expedience, fresher and experienced Java collections interview questions download, beginner Java Technical Interview Questions, senior Java Technical Interview Questions, fresher Java Technical Interview Questions