0% found this document useful (0 votes)
58 views

Interview Questions - Success of Java

Java became successful due to its portable, freely downloadable and open source nature. It allows software to be written once and run on any system without needing to be recompiled, due to its Write Once Run Anywhere (WORA) capability. Java is considered an internet programming language because of its portable features. Key factors in Java's success include its platform independence, ability to execute on any system regardless of operating system, and its open source nature which allowed independent developers to contribute enhancements.

Uploaded by

jflksdjf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Interview Questions - Success of Java

Java became successful due to its portable, freely downloadable and open source nature. It allows software to be written once and run on any system without needing to be recompiled, due to its Write Once Run Anywhere (WORA) capability. Java is considered an internet programming language because of its portable features. Key factors in Java's success include its platform independence, ability to execute on any system regardless of operating system, and its open source nature which allowed independent developers to contribute enhancements.

Uploaded by

jflksdjf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Success of Java

1. What are the reasons for Java's success?


a) Portable
b) Freely downloadable
c) Open source
2. What is WORA?
Write Once Run Anywhere feature of java.
3. Why is Java called an Internet Programming language?
Because of the portable features of java.

4. What is meant by platform independence?


It refers to the portable feature of java. i.e. java programs can be executed on
any system irrespective of the OS.

5. What is meant by open source?

Open source software is such a software for which modifications and


enhancements can not only be performed by the Engineers of the company but
can also be performed by freelancers or independent thinkers or Engineers of
other companies etc.

6. What is an assembler?

Assembler is a software which converts an assembly level language code


to machine level language code.

7. What is a compiler?

Compiler is a software which converts high level language code to machine


level code (C, C++) or high level language code to bytecode (java compiler).

1
8. What was Java initially known as?

C++++--, green and oak

9. Who were the inventors of Java?

James Gosling, Mike Sheridan, Patrick Naughton and 8 more members.

10. Which company's product was Java initially?

Sun Micro Systems.

11. Which company's product is Java currently?

Oracle

12. What is JVM?

JVM stands for Java Virtual Machine. It is the software which accepts byte
code as its input and produces machine level code as its output.

13. Is the JVM platform dependent or independent? Why?

Platform dependent, because it is coded in C language to increase the execution


speed of JVM.

14. What is a class file?

Class file is a file which contains byte code.

15. What is an intermediate code?

Intermediate code is such a code which is neither in high level nor in machine
level. It is also called bytecode.

2
16. What is a class loader?

Class Loader is the part of Java Runtime Environment (JRE) that


dynamically loads java classes into the Java Virtual Machine.

17. What is a byte code verifier?

Byte code verifier is part of JRE. It ensures the security of the system. It verifies
all the bytecodes before it gets executed.

18. What is an interpreter?

Interpreter is a software which converts high level code to machine level code.
Until and unless a statement is interpreted and executed the next high level
statement would not get interpreted.

19. What is the difference between compiler and interpreter?

Compiler Interpreter

All the statements present in the Only the current statement is


program are compiled interpreted

All the statements in program are Only the current interpreted


loaded onto the ram statement would be loaded onto the
ram.

Program execution is fast Program execution is slow

3
20. What is JIT?

JIT stands for Just In Time Compiler. It is the part of JVM. Compilation would
be done during the execution of a program at runtime. It usually runs more
quickly in the computer because it compiles the bytecode into platform-specific
executable code that is immediately executed. JIT compiler is enabled by
default. When a method has been compiled, the JVM calls the compiled code of
that method directly instead of interpreting it.

21. What is JRE?


JRE stands for Java Runtime Environment. It is a portion of the memory
allocated on the RAM by the OS for the execution of a java program.
22. Is Java a compiled or interpreted language?
Java combines both the approaches of compilation and interpretation.
First, java compiler compiles the source code into bytecode. At the run time,
Java Virtual Machine interprets this bytecode and generates machine code
which will be directly executed by the machine in which java programs runs. So
java is both compiled and interpreted language.

23. What is Run Time System?

RTS stands for Run Time System ,it is a part of JVM. It is involved in
Exception Handling.

24. What is JDK?

JDK stands for Java Development Kit. It consists of all the required
software such as Java Compiler, Class Loader, Byte Code Verifier, Java Class
Libraries, Java Interpreter, Just In Time Compiler and Runtime System for the
development of a java project.

25. What is the latest version of Java available and when was it released?

Java SE 11.0.1, September 2018

4
26. Which is the next version of Java and when would it be released?

Java SE 12, March 2019

27. How did Java drastically grow in features?

Because Java was open source, many freelancers contributed their ideas and
added many features and hence Java grew rich in features.

28. What is the disadvantage of java?

Execution of a Java program is relatively slow when compared to C and C++


because in Java, High level code would be converted into byte code first and
then byte code would be converted into machine level code.

29. When was first version of Java officially released?

1994

30. Since when was Java unofficially available?

1992

31. Explain the architecture of Java.

Java combines both the approaches of compilation and interpretation. Java


source file is given as input to java compiler, which gives class file which
contains byte codes. This class file is given as input to class loader, the duty of
class loader is to take all the library files in java class libraries and make a
complete class file. This complete class file should be given as input to JVM
and JVM is going to convert bytecodes into machine level code. This machine
level code is given to processor and hence it gives output.

(For diagram, refer class notes)

5
32. What is meant by architecture neutrality?

If a software is capable of executing on any OS microprocessor combination


then it is said to be architecture neutral.

33. How is object file different from class file?

Object file contains code in machine level whereas Class file contains code in
intermediate level i.e. byte code

Object file is machine dependent whereas class file is machine independent.

34. Is class file platform dependent?

No. If a source file has more than one class, each class is compiled into a
separate class file. JVMs are available for many platforms, and a class file
compiled on one platform will execute on a JVM of another platform. This
makes Java applications platform-independent.

35. Is object file platform dependent?

Yes. An object file is a file which contains the program in machine level and
hence it is platform dependent

36. Can we have single JVM on a system which has multiple OS?

No, JVM is platform dependent and a single JVM cannot work with many OS.
Rather each OS would be having a JVM of its own.

37. What is meant by a platform?

The combination of OS and Hardware(Microprocessor) is called as platform

38. Comment on the speed of Java.

6
It is relatively slow in execution.

39. What category of applications can be developed using Java?

Internet applications (Portable applications) which demand architecture


neutrality can be developed using Java.

40. What is the single most important feature of Java that lead to its
success?

Portability
41. What is the difference between JDK and JVM?
JVM is a part of JDK.
For a java program to be successfully executed a collection of software are
required. This collection of software which can be freely downloadable from
internet is referred to as “Java Development Kit” or JDK, whereas JVM stands
for Java Virtual Machine. It is the software which accepts byte code as its input
and produces machine level code as its output.

42. What is meant by loading?


Loading is the process of taking a copy of the data present on the hard disk and
placing it on the RAM.

43. What is meant by saving?


Saving is the process of taking a copy of the data present on the RAM and
placing it on the Hard disk.

44. Why do we have two types of memories in our computer?


Because there is no single memory which can satisfy all the 4 expectations of
the user i.e.
1) Inexpensive
2) Fast
3) Non-volatile and
4) Compact.

7
Hence, we have two memories in our computer which can satisfy 2
expectations each.

45. Why is the primary memory called as “main memory”?


Because it is directly connected to the microprocessor.

46. Why is hard-disk called as the “secondary memory”?


Because it is not directly connected to the microprocessor.

47. What is a pointer and does Java support pointers?


Java does not support pointers. However, java has reference referring to an
object.

48. What is difference between Path and Classpath?


Path is an environmental variable which is used by the OS to find the
executables. Classpath is an environment variable which is used by the Java
compiler to find the path of classes. i.e. in J2EE we give the path of jar files.

49. What environment variables do I need to set on my machine in order to


be able to run Java programs?
CLASSPATH and PATH

50. What is an object file?


An object file is a file which contains the program in machine level code. It is
incomplete and hence cannot be executed.

51. What is an executable file?


An executable file is a file which contains program in machine level code. It is
complete because linking has been performed and hence it can be executed.

52. Is an object file executable?


No, because it is incomplete

53. Is an executable file executable?


Yes, because it is complete

8
54. What is a linkage editor?
It is a software which links the object file with the required library files and
produces an executable file.

55. What is linking loader?


It is a software which performs linking of object file with the required library
files to produce an executable file and also loads it onto the RAM.

56. What is an executable image?


An executable file when loaded onto the ram, it is called as an executable
image.

57. What are library files?


Library files are the files which are created on the hard disk during the
installation of a programming language and it would contain bodies to inbuilt
functions present in machine level language.

58. Do library files contain code in HLL?


No.

59. Are library files machine dependent?


Yes, because they contain code in machine level language.

60. Why can’t we execute an object file?


Because object file is incomplete.

61. Can we send HLL code over internet? Comment.


Yes, we can send it over the internet but it is not recommended due to security
reasons.

62. Can we send MLL code over internet? Comment.


Yes, we can send it over the internet. But since MLL code is machine
dependent, the portability feature of Java cannot be achieved.

9
63. Can we send IL code over internet? Comment.
Yes, and it is recommended to send Intermediate level code as it is both secured
and machine independent as well.

64. Why can’t we have a single JVM to work for all OS?
Because JVM is platform dependent. There is a specific JVM for a specific OS.

65. What are the reasons for java’s slowness?


A java program does not directly produce the machine code. Rather, upon
compilation it produces intermediate code. This intermediate code must be
converted into machine code by JVM. This slows down the execution process of
java program.

10

You might also like