OBJECT ORIENTED PROGRAMMING TOPIC – DIFFERENCE BETWEEN JAVA & C NAME – AVIK BOSE UNIVERSITY ROLL NO - 14501221084
INRODUCTION JAVA – Java is an object –oriented programming language that produces software for multiple platforms . When a programmer writes a Java application, the complied code (known as bytecode) runs on most operating systems (OS) , including Windows , Linux and MAC OS . Java derives much of its syntax from the C and C++ programming language C – C is a powerful general –purpose programming language . It can be used to develop software like operating systems , databases , compilers and so on . C programming is language to learn program for beginners .
HISTORY C was developed by Dennis M. Ritchie between 1969 and 1973 . C was originally developed for UNIX Operating Systems to beat the issues of previous language such as B , BCPL , ETC. Java was created at Sun Microsystems . It was originally designed for interactive television , but it was too advance technology for the digital cable industry at the time . The principles of Java programming were “Simple , Robust , Portable , Platform-independent , Secured , High Performance , Multi-threaded , Architecture Neutral , Object-Oriented , Interpreted and Dynamic” . Java is developed by JAMES GOSLING , who is known as father of java , in 1995 . Java developing was started in early 90s .
KEY FEATURES OF JAVA One of the most interesting and important features which Java supports is the WORA – Write Once Run Anywhere – features . Once compiled , Java code can be run on any computing platform . For example , if a code has been written on a MAC Operating system , the same code can be run on a WINDOWS Operating Systems without any trouble if the Windows operating system has JVM(Java Virtual Machine) installed on it . Java is purely an Object-Oriented-Programming Language , that’s why , all Java codes are always written in the form of classes and objects . Java is a multi-threaded language with automatic memory management . It has great features for garbage collection and is heavily used for distributed computing because of its network – centricity . Java is dynamic and extensible . Java is also secure and robust .
KEY FEATURES OF C C is a structured programming language that is extremely easy to learn . It is an efficient programming language , it is fast and has very good performance . C is a highly portable and extensible programming language because it is not tied to any hardware or systems . Any code written in C can be run on any machine which supports C , without modifying a single line a code . C has a rich set of built-in Operators and libraries with functions . C is modular and statically typed . C is a Procedure Oriented Programming language (POPs) . C is a high level language with low level features .
LANGUAGE TYPE C language C is a procedural programming language . C is more procedure - oriented . C is a middle – level language because binding of the gaps takes place between machine – level language and high – level languages . JAVA language Java is an Object-Oriented language . Java is more data-oriented . Java is a high – level language because the translation of code takes place into machine language using a compiler or interpreter . c JAVA
PROGAMMING PARADIGMS AND OBJECT MANAGEMENT C is generally breaks down to functions . It is more procedure oriented . In C one has to manage object manually . Java breaks down to Objects . It is more data-oriented . In Java object is automatically managed by the garbage collector . C language JAVA language
MEMORY ALLOCATION Memory allocation can be done by malloc. For freeing the memory one has to use free . Memory allocation can be done by a new keyword . Compiler will do it internally by calling the garbage collector c Java
CALLING FUNCTIONALITY , VARIABLE DECALRATION & KEYWORDS It supports call by value and call be reference . Declaration of variables should by at the beginning of the block . It has 32 keywords . It only supports the call by value . We can declare variables anywhere through it is a good practice to declare the variables at the beginning of the block . It has 50 keywords . JAVA c
DIFFERENCE BETWEEN JAVA AND C V It is based on Write Once Compile Anywhere . C is only compiled and not interpreted . C has support for pointers . C follows a top-down approach . C is not a robust programming language . S It is based on Write Once Run Anywhere . Java is both compiled and interpreted . Java does not supports pointers . Java follows a bottom – up approach . Java is a robust programming language as it has strong memory management schemes . C JAVA