Posts

Differences between Java and C

  Differences between Java and C: Differences between Java and C Java is an object oriented language. In an effort to build simple and safe language, the java team did not include some of the c features in Java. ·          Java does not include the C language statement keywords sizeof , and typedef. ·          Java does not contain the data types struct and union . ·          Java does not define the type modifiers keywords auto, extern, signed, and unsigned. ·          Java does not support an explicit pointer type. ·          Java does not have a pre-processor and therefore we cannot use #define, #include, and #ifdef . ·          Java requires that the functions with no arguments must be declared with empty parenthesis and not ...

JAVA NOTES

Image
 OOPs BASICS:                       Object Oriented Programming (OOP) is an approach to program organization and development, which attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several new concepts. However not all languages are suitable to implement the OOP concept easily. Languages that support OOP features include Smalltalk, C++, Ada and object pascal.  Object Oriented Paradigm:           The major Objective of Object Oriented approach is to eliminate some of the flaws encountered in the procedural approach. OOP treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the functions that operate on it and protects it from unintentional modification. OOP allows us to decompose a pro...

JAVA NOTES

 HISTORY Java's history  began in 1991 at Sun Microsystems with James Gosling and his team, initially working on the "Green Project" .   The language was later named Oak, then Java, and publicly introduced in 1995 as a platform-independent language.  Sun Microsystems later became Oracle, and Java's stewardship has continued with Oracle.   1991: The "Green Project" begins at Sun Microsystems, led by James Gosling. 1992: The prototype, "Oak," is developed. 1994: The team refocuses on web-based applications. 1995: Java is publicly released by Sun Microsystems, emphasizing "Write Once, Run Anywhere" portability. 2006: Sun Microsystems makes Java's core components open-source. 2009: Oracle acquires Sun Microsystems, becoming Java's steward. 2014: Java 8 is released, modernizing the language with new features. 2017: Oracle adopts a six-month release cycle, accelerating updates
Image
  FILES USED IN A C PROGRAM: In C four types of files are used while writing and executing. They are Source code file   •          The source code file contains the source code of the program. The file extension of any C source code file is “.c”. This file contains C source code that defines the main function and maybe other functions. The main() is the starting point of execution when you successfully compile and run the program. A C program in general may include even other source code files (with the file extension .c). Header Files •          When working with large projects, it is often desirable to make sub-routines and store them in a different file known as header file. The advantage of header files can be realized when a)       The programmer wants to use the same subroutines in different programs.   b)       The program...
  first program in C #include<stdio.h> int main() { printf("\n Welcome to the world of C "); return 0; }
Image
  structure of C Program? Ans: A C program contains one or more functions. The statements in a C program are written in a logical sequence to perform a specific task. Execution of a C program begins at the main() function . You can choose any name for the functions. Every program must contain one function that has its name as main(). STRUCTURE OF A C PROGRAM A C program may contain one more sections as shown in below Documentation Section: The documentation section consists of a set of comment lines giving the name of the program, the author and other details. Link Section: The link section provides instructions to the compiler to link functions from the system library. Definition Section: The definition section defines all symbolic constants. Global Declaration Section: There are some variable that are used in more than one function. Such variables are called global variables and are declared in the global declaration section that is outside of all the functions. This ...
  Characteristics & Importance of C: §   It is a robust language whose rich set of built-in functions and operators can be used to write any complex program. §   The C compiler combines the capabilities of an assembly language with features of high-level language and therefore it is well suited for writing both system software and business packages. §   Programs written in C are efficient and fast. This is due to its variety of data types and powerful operators. There are only 32 keywords and its strength lies in its built-in functions. Several standard functions are available which can be used for developing programs. §   C is highly portable. This means that C programs written for one computer can be run on another with little or no modification. §   C Language is well suited for structured programming, thus requiring the used to think of a problem in terms of function modules or blocks. A proper collection of these modules would make a comp...