Skip to main content

Q) What are the features of java makes it distinct from other conventional programming language ? How is it possible ? What is its benefit ?



A)

1) Java applications are platform independent (architectural neutral).
2) That means, if we develop and compile a java application in one operating system (os) environment, the resultant file (class file) can be executed in any other os environment. This is nothing but platform independency.
“Operating system + hardware (processor) = platform
Java programs os independent.
Os is considered as “real machines”.
Ex: windows machine, linux machine, mac machine.
Same source code compiles & run at any environment with zero modifications or less modifications that is called portability.
Ex: java programs.
After compile over the resultant file run at any other environment. That is called platform independent.
Ex: java
The c and c++ programs in which os the file is compiled that exe file is understand by that processor only not understand by other processor. That’s why they are not platform independent. So, the c and c++ are not portable.
Java programs don’t run directly on os. Therefore java  applications are os independent.

Two things contribute to the os independency of java applications.
    1)      Class file
    2)    os dependent JVM(java virtual machine)
If we compile java programs in any os that produce same class file.
If we compile a java application in any os environment we get same class file(s).
When compile c or c++ that produce exe file that contain instructions to that particular os only. So that is os dependent.
A class file contains byte code. Byte code contains instructions understandable to any kind of JVM.JVMs are many kinds.
JVMs are os dependent.
JVM :
        JVM is a special software that provides execution environment for java programs main goal of JVM is to execute java applications.

        JVMs are os dependent.
            Ex : JVM for windows different.
                    JVM for unix different.
JVM converts byte code into underlying os understandable machine instructions to be given to the process. JVM is a translator.
For java programs real machine is not provide execution environment.  The JVM only provide the execution environment for conventional program.
If an application is os independent developers need not be thinking about os specific functionality and as all the users can use it. More market and hence at cheaper price software can be produced.

Comments

Popular posts from this blog

Q) Explain repeated deletion of records.

A) //RepeatedDeletion.java import java.util.Scanner; import java.sql.*; class RepeatedDeletion {        public static void main(String[] args) {               Connection con= DriverManager. getConnection ( "jdbc:odbc:prince" , "scott" , "tiger" );               PreparedStatement ps=con.PreparedStatement( "DELETE FROM ACCOUNT WHERE ACCNO=?" );               Scanner s= new Scanner(System. in );               while ( true )               {                      System. out .println( "Enter accno : " );      ...

Introduction

1) What is not JDBC? 2) What is the purpose of JDBC? 3) What is ODBC? 4) What is JDBC? 5) What is JDBC architecture? 6) What is JDBC client? What are its responsibilities? 7) What is JDBC API?  8) What is driver manager? 9) What is JDBC driver? What is its role in java database connection? 10) What is database server?

Q) Explain about nested classes?

A) ->defining a class with in another class is known as nesting of the class. Ex: class A {        class B        {                      } //nested class, and inner class.because it is not static class. } //enclosing class or outer class. ->static class is declared in inside an another class then it does not become an inner class. Note: non-static nested class is known as “inner class”. In the above example class B is nested but not an inner class. Ex: class D {        static c        {                      } //nested class, but not an inner class , because of static class. } //outer class. ->we have three different kinds of inner classes. 1) Member inner class 2) Meth...