The document discusses object-oriented programming concepts including classes, objects, encapsulation, inheritance, polymorphism, and design patterns. It defines each concept and provides examples to illustrate how they are used in object-oriented programming and modeling. Object-oriented programming is based on representing real-world entities like cars and people as objects that have states, behaviors, and can communicate with each other through messages.
The document discusses object-oriented programming (OOP) concepts like abstraction, encapsulation, inheritance, and polymorphism. It then covers design patterns, the Unified Modeling Language (UML), and provides an example case study of developing a student information system using Java and related technologies. The key topics are introduced at a high-level with the goal of demonstrating practical OOP through the case study example.
The document provides instructions for printing PowerPoint lectures in black and white to save printer ink. It advises users to select "File > Print", then change the "Color" setting to "Pure Black and White" to print without using color ink.
This document provides an overview of key object-oriented concepts including encapsulation, abstraction, inheritance, and polymorphism. Encapsulation involves grouping related data and procedures together and controlling access to an object's data. Abstraction focuses on common behaviors across objects rather than implementation details. Inheritance organizes similar objects in a hierarchy to consolidate common functionality. Polymorphism allows modifying inherited behaviors in descendant classes. The document uses examples of reactive substances like Mentos and Diet Coke to illustrate these concepts.
- Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. It runs on a variety of platforms such as Windows, Mac OS, and UNIX.
- The Java Virtual Machine (JVM) allows Java code to run on different platforms, as the bytecode is interpreted by the JVM rather than being compiled into platform-specific machine code.
- Some key features of Java include being object-oriented, platform independent, robust, interpreted, and multi-threaded.
Std 12 computer chapter 6 object oriented concepts (part 1) by Nuzhat Memon
Introduction to class and object
Procedural (Structural) programming language
Object Oriented programming language
Two ways of programming language (POP and OOP)
four specific object properties
4 pillars of OOPs
Encapsulation in Java
Abstraction in Java
Messaging in Java
Polymorphism in Java
This document discusses object-oriented programming (OOP) and its advantages over other programming paradigms. It begins with an introduction to programming paradigms including procedural, object-based, and object-oriented. The key concepts of OOP are then defined, including abstraction, encapsulation, modularity, inheritance, and polymorphism. Advantages of OOP include code reusability, ease of understanding and maintenance. Disadvantages include potential overgeneralization of classes and difficulty of proper planning and design.
The document discusses object-oriented programming (OOP). It defines some key concepts in OOP including objects, classes, abstraction/encapsulation, inheritance, and polymorphism. Objects have identity, state, and behavior. Classes group similar objects and define their attributes and methods. Abstraction hides unnecessary details, while encapsulation bundles related data and functions into a class. Inheritance allows classes to inherit characteristics from other classes. Polymorphism means an object can take on multiple forms. Benefits of OOP include reusability, extensibility, understandability, and protection.
The course aims to provide you with an understanding of the fundamental concepts involved in object-oriented programming (object, class, protocol, hierarchy, inheritance, encapsulation, polymorphism and collaboration).
The programming language you will use is Java. However, the purpose of the course is not to teach you the minutiae of the Java language, but rather to teach you fundamental object-oriented programming concepts and skills that will be transferable to any object¬ oriented language
This document discusses key concepts in object-oriented programming (OOP) including what OOP is, the differences between procedural and object-oriented programming, advantages of OOP, what objects and classes are, and core OOP concepts in Java like abstraction, encapsulation, inheritance, and polymorphism. It provides definitions and examples to explain each concept.
Introduction to object oriented languagefarhan amjad
This document discusses object-oriented programming (OOP) and its advantages over procedural programming. It defines some key OOP concepts like objects, classes, encapsulation, and inheritance. It explains that in OOP, programs are designed as collections of these discrete objects that combine data and behaviors. This reduces complexity and promotes reusability, flexibility, and maintainability. OOP also gives data more importance and provides mechanisms to hide data that procedural languages lack.
This document provides an introduction to object-oriented concepts, modeling, and system development. It discusses key topics such as:
- The benefits of object-oriented programming like modularity, information hiding, and code reuse.
- Basic concepts in OOP like objects, classes, encapsulation, inheritance, and polymorphism.
- The role of modeling in engineering by providing information about systems before they are built through mapping, reducing complexity, and being pragmatic.
- Object-oriented analysis focuses on understanding a system's functional requirements, unlike traditional function/data analysis which considers behavior and data separately.
This document defines object-oriented programming and compares it to structured programming. It outlines the main principles of OOP including encapsulation, abstraction, inheritance, and polymorphism. Encapsulation binds code and data together for security and consistency. Abstraction hides implementation details and provides functionality. Inheritance allows classes to acquire properties from other classes in a hierarchy. Polymorphism enables different types to perform the same methods.
Brainsmartlabs is one of the excellent online tutorials for beginners which offers the best java and core java courses online. Enroll now to learn core java programming from scratch and become an expert.
An overview of object oriented programming including the differences between OOP and the traditional structural approach, definitions of class and objects, and an easy coding example in C++. This presentation includes visual aids to make the concepts easier to understand.
Object oriented programming (OOP) addresses limitations of procedural programming by dividing programs into objects that encapsulate both data and behaviors. OOP supports features like inheritance, polymorphism, and abstraction. Inheritance allows new classes to inherit attributes and behaviors from parent classes, polymorphism allows the same message to be interpreted differently depending on the object receiving it, and abstraction focuses on essential characteristics without implementation details. These features help make programs more modular, reusable, and maintainable.
This document discusses various programming paradigms including procedural programming, object-based programming, and object-oriented programming. It provides details on key concepts of OOP like data abstraction, encapsulation, inheritance, and polymorphism. The document also lists advantages of OOP like reusability and ease of maintenance, as well as disadvantages like potential overgeneralization of classes.
Object Oriented Programming in Java _lecture 1Mahmoud Alfarra
Introduction to OOP
Let’s start with the first set of concepts
What is Object-Oriented Programming ?
Procedural vs. Object-Oriented Programming
OO Programming Concepts
OOPs concepts include objects, classes, encapsulation, inheritance, and polymorphism. Objects are run-time entities that can access class data through associated methods. Classes are user-defined data types that implement abstraction and encapsulation. Encapsulation provides an interface between an object's data and the program. Inheritance allows classes to inherit properties from superclasses and subclasses. Polymorphism allows an object to take different forms depending on its data type. Constructors initialize objects and destructors finalize them. OOPs benefits applications by building secure, modularized programs that are reusable and allow interference-free object coexistence.
This document provides a syllabus for a Java Programming course. The course consists of 7 topics that will be covered through lectures and practical sessions over several weeks. Students will have one exam worth 100 marks and a practical exam worth 50 marks. They will also complete term work assignments worth 25 marks. The topics covered include Java fundamentals, classes, exception handling, IO packages, multi-threading, GUI, and database connectivity. Students will submit programming assignments related to these topics as part of their term work. References for the course are also provided.
This document provides an overview of object-oriented programming concepts in Java including encapsulation, inheritance, polymorphism, and abstraction. It also discusses key Java features like classes, interfaces, access modifiers, and differences between abstract classes and interfaces. Object-oriented principles like encapsulation, inheritance and polymorphism are explained along with examples. Common questions about Java concepts are also addressed at the end.
Object-oriented programming (OOP) models real-world objects like their attributes and behaviors, grouping similar objects into classes. The four main principles of OOP are encapsulation, abstraction, inheritance and polymorphism. OOP aims to reuse code through classes, make debugging and testing easier, and better model real-world problems compared to structured/functional programming.
The document discusses key concepts in Object Oriented Programming including objects, classes, inheritance, polymorphism, abstraction, and encapsulation. It defines each concept and provides examples. Objects have state, behavior, and identity. A class is a template for creating objects that share common properties. Inheritance allows an object to acquire properties of a parent object. Polymorphism allows one task to be performed in different ways. Abstraction hides internal details and shows functionality. Encapsulation binds code and data into a single unit.
This document provides an overview of object-oriented programming concepts including:
1. It discusses the evolution of programming languages from low-level languages close to the machine to high-level languages close to the problem being solved.
2. Key concepts of object-oriented programming like encapsulation, abstraction, inheritance and polymorphism are explained.
3. The advantages of OOP like reusability, easy maintenance and modeling real-world problems are highlighted along with some disadvantages like over generalization of classes.
Object Oriented Programming All Unit NotesBalamuruganV28
The document provides an overview of object-oriented programming (OOP) and the Java programming language. It defines key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also describes features of Java like platform independence, simplicity, security, and robustness. The document then explains basic Java concepts like data types, variables, arrays, control structures, and defining classes, constructors, and methods. It provides examples of operators in Java and the difference between procedural and object-oriented programming.
The document discusses object-oriented programming and several key concepts:
1) OOP organizes programs around objects and well-defined interfaces rather than procedural code. This improves modularity and reuse.
2) Objects encapsulate both data (attributes) and behaviors (methods) and communicate via messages. This mimics the real world.
3) Distributed object systems allow objects to communicate across a network. Paradigms like remote method invocation, object request brokers, and object spaces define how this is implemented.
The document discusses object-oriented programming (OOP). It defines some key concepts in OOP including objects, classes, abstraction/encapsulation, inheritance, and polymorphism. Objects have identity, state, and behavior. Classes group similar objects and define their attributes and methods. Abstraction hides unnecessary details, while encapsulation bundles related data and functions into a class. Inheritance allows classes to inherit characteristics from other classes. Polymorphism means an object can take on multiple forms. Benefits of OOP include reusability, extensibility, understandability, and protection.
The course aims to provide you with an understanding of the fundamental concepts involved in object-oriented programming (object, class, protocol, hierarchy, inheritance, encapsulation, polymorphism and collaboration).
The programming language you will use is Java. However, the purpose of the course is not to teach you the minutiae of the Java language, but rather to teach you fundamental object-oriented programming concepts and skills that will be transferable to any object¬ oriented language
This document discusses key concepts in object-oriented programming (OOP) including what OOP is, the differences between procedural and object-oriented programming, advantages of OOP, what objects and classes are, and core OOP concepts in Java like abstraction, encapsulation, inheritance, and polymorphism. It provides definitions and examples to explain each concept.
Introduction to object oriented languagefarhan amjad
This document discusses object-oriented programming (OOP) and its advantages over procedural programming. It defines some key OOP concepts like objects, classes, encapsulation, and inheritance. It explains that in OOP, programs are designed as collections of these discrete objects that combine data and behaviors. This reduces complexity and promotes reusability, flexibility, and maintainability. OOP also gives data more importance and provides mechanisms to hide data that procedural languages lack.
This document provides an introduction to object-oriented concepts, modeling, and system development. It discusses key topics such as:
- The benefits of object-oriented programming like modularity, information hiding, and code reuse.
- Basic concepts in OOP like objects, classes, encapsulation, inheritance, and polymorphism.
- The role of modeling in engineering by providing information about systems before they are built through mapping, reducing complexity, and being pragmatic.
- Object-oriented analysis focuses on understanding a system's functional requirements, unlike traditional function/data analysis which considers behavior and data separately.
This document defines object-oriented programming and compares it to structured programming. It outlines the main principles of OOP including encapsulation, abstraction, inheritance, and polymorphism. Encapsulation binds code and data together for security and consistency. Abstraction hides implementation details and provides functionality. Inheritance allows classes to acquire properties from other classes in a hierarchy. Polymorphism enables different types to perform the same methods.
Brainsmartlabs is one of the excellent online tutorials for beginners which offers the best java and core java courses online. Enroll now to learn core java programming from scratch and become an expert.
An overview of object oriented programming including the differences between OOP and the traditional structural approach, definitions of class and objects, and an easy coding example in C++. This presentation includes visual aids to make the concepts easier to understand.
Object oriented programming (OOP) addresses limitations of procedural programming by dividing programs into objects that encapsulate both data and behaviors. OOP supports features like inheritance, polymorphism, and abstraction. Inheritance allows new classes to inherit attributes and behaviors from parent classes, polymorphism allows the same message to be interpreted differently depending on the object receiving it, and abstraction focuses on essential characteristics without implementation details. These features help make programs more modular, reusable, and maintainable.
This document discusses various programming paradigms including procedural programming, object-based programming, and object-oriented programming. It provides details on key concepts of OOP like data abstraction, encapsulation, inheritance, and polymorphism. The document also lists advantages of OOP like reusability and ease of maintenance, as well as disadvantages like potential overgeneralization of classes.
Object Oriented Programming in Java _lecture 1Mahmoud Alfarra
Introduction to OOP
Let’s start with the first set of concepts
What is Object-Oriented Programming ?
Procedural vs. Object-Oriented Programming
OO Programming Concepts
OOPs concepts include objects, classes, encapsulation, inheritance, and polymorphism. Objects are run-time entities that can access class data through associated methods. Classes are user-defined data types that implement abstraction and encapsulation. Encapsulation provides an interface between an object's data and the program. Inheritance allows classes to inherit properties from superclasses and subclasses. Polymorphism allows an object to take different forms depending on its data type. Constructors initialize objects and destructors finalize them. OOPs benefits applications by building secure, modularized programs that are reusable and allow interference-free object coexistence.
This document provides a syllabus for a Java Programming course. The course consists of 7 topics that will be covered through lectures and practical sessions over several weeks. Students will have one exam worth 100 marks and a practical exam worth 50 marks. They will also complete term work assignments worth 25 marks. The topics covered include Java fundamentals, classes, exception handling, IO packages, multi-threading, GUI, and database connectivity. Students will submit programming assignments related to these topics as part of their term work. References for the course are also provided.
This document provides an overview of object-oriented programming concepts in Java including encapsulation, inheritance, polymorphism, and abstraction. It also discusses key Java features like classes, interfaces, access modifiers, and differences between abstract classes and interfaces. Object-oriented principles like encapsulation, inheritance and polymorphism are explained along with examples. Common questions about Java concepts are also addressed at the end.
Object-oriented programming (OOP) models real-world objects like their attributes and behaviors, grouping similar objects into classes. The four main principles of OOP are encapsulation, abstraction, inheritance and polymorphism. OOP aims to reuse code through classes, make debugging and testing easier, and better model real-world problems compared to structured/functional programming.
The document discusses key concepts in Object Oriented Programming including objects, classes, inheritance, polymorphism, abstraction, and encapsulation. It defines each concept and provides examples. Objects have state, behavior, and identity. A class is a template for creating objects that share common properties. Inheritance allows an object to acquire properties of a parent object. Polymorphism allows one task to be performed in different ways. Abstraction hides internal details and shows functionality. Encapsulation binds code and data into a single unit.
This document provides an overview of object-oriented programming concepts including:
1. It discusses the evolution of programming languages from low-level languages close to the machine to high-level languages close to the problem being solved.
2. Key concepts of object-oriented programming like encapsulation, abstraction, inheritance and polymorphism are explained.
3. The advantages of OOP like reusability, easy maintenance and modeling real-world problems are highlighted along with some disadvantages like over generalization of classes.
Object Oriented Programming All Unit NotesBalamuruganV28
The document provides an overview of object-oriented programming (OOP) and the Java programming language. It defines key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also describes features of Java like platform independence, simplicity, security, and robustness. The document then explains basic Java concepts like data types, variables, arrays, control structures, and defining classes, constructors, and methods. It provides examples of operators in Java and the difference between procedural and object-oriented programming.
The document discusses object-oriented programming and several key concepts:
1) OOP organizes programs around objects and well-defined interfaces rather than procedural code. This improves modularity and reuse.
2) Objects encapsulate both data (attributes) and behaviors (methods) and communicate via messages. This mimics the real world.
3) Distributed object systems allow objects to communicate across a network. Paradigms like remote method invocation, object request brokers, and object spaces define how this is implemented.
The document provides an introduction to object-oriented programming (OOP) concepts in Java, including defining classes, objects, inheritance, polymorphism, abstraction, and encapsulation. It then discusses the key characteristics of Java like being platform independent, secure, robust, and having automatic memory management via garbage collection. The structure of a Java program and environment is also explained, covering Java source files, the Java compiler, Java Runtime Environment, Java Development Kit, and Java Virtual Machine.
Software objects contain state and behavior. An object's state is stored in fields and its behavior is exposed through methods. Hiding internal data and only allowing access through methods is known as encapsulation. Common behavior can be defined in a superclass and inherited into subclasses using the extends keyword. A collection of related classes organized into a namespace is called a package.
This document provides an introduction to the Java programming language. It describes the course on Java being taught, including location, schedule, and instructor. It then discusses Java's history, features, the Java Virtual Machine (JVM) and its architecture. Finally, it introduces object-oriented programming concepts like objects, classes, and provides a simple example Java program.
The document provides an overview of object-oriented concepts. It discusses that software development is increasingly relying on object-oriented paradigms due to benefits like improved modeling of real-world problems and reusability. Key concepts discussed include classes and objects, encapsulation, inheritance, polymorphism, and object composition. Various object-oriented methodologies like those proposed by Coad/Yourdon, Booch, Rumbaugh, and Jacobson are also summarized.
This document provides information on object-oriented programming concepts in Java. It discusses objects and classes, defining that an object has state and behavior while a class is a template for objects. It also covers OOPs concepts like inheritance, polymorphism, abstraction and encapsulation. Examples are provided of defining classes with methods and instantiating objects in Java.
The document provides an introduction to Java and object-oriented programming concepts. It discusses how computer programs are based on algorithms and step-by-step instructions. It then explains procedural programming versus object-oriented programming, with examples like C++ and Java listed as OOP languages. The basics of classes, objects, encapsulation, inheritance, and polymorphism are defined as core OOP concepts. Finally, it provides an overview of the Java programming language and environment.
This document provides a syllabus for a Java programming course including:
- 7 topics that will be covered ranging from Java fundamentals to database connectivity.
- A practical exam worth 50 marks involving 10 programming assignments.
- 12 programming assignments that will be completed as part of the term work.
- 4 references books that will be used for the course.
object oriented programming through java basicsRohit Kumar
a way of viewing the world.java buzz words, java programming, constructor, method overloading and overridding,default constructors,parameterized constructors,
This document provides an introduction to Java programming language. It discusses that Java was originally developed by Sun Microsystems in 1991 and was originally called OAK. It describes key characteristics of Java like being simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, multithreaded and dynamic. It also discusses features of the Java Virtual Machine like garbage collection, just-in-time compilation, security, and class loading. The document then covers Java versions, data types, naming conventions, object-oriented concepts like objects, classes, inheritance, polymorphism, abstraction and encapsulation. It concludes with brief descriptions of MySQL database.
Java was conceived as a language for developing advanced software across a variety of network devices and systems. It draws influence from languages like C++ and aims to provide a platform for developing secure, high-performance, robust applications across multiple platforms in distributed networks. Java uses object-oriented programming, with classes and objects modeling real-world entities. A Java program consists of classes with fields and methods, and it must contain a main method where execution begins. Variables are used to store and manipulate data in a program.
This document provides an introduction to Java and object-oriented programming concepts. It discusses how Java was designed to develop advanced software for network devices and systems. It then defines Java as an object-oriented programming language where code written to model real-world objects is called a class. The document also explains key object-oriented programming concepts like classes, objects, encapsulation, inheritance and polymorphism. It provides details on the object lifecycle of creation, usage and disposal in Java.
Mastering Java Terminologies_ Essential Concepts for Beginners.pdfCodeYoung
Java is a high-level, class-based, object-oriented programming language designed to be as easy to learn as it is powerful. Originally developed by James Gosling at Sun Microsystems and released in 1995, Java was designed to have as few implementation dependencies as possible, making it a versatile choice for developers. Today, Java powers everything from enterprise-level applications to Android apps, web servers, and even embedded systems.
Before you start coding in the Java programming language, it’s essential to understand various basic Java terminology. These concepts form the core of Java programming and will help you make sense of the Java code you write and read. Let’s dive into some of the key terms:
1. Variable
A variable in Java is like a storage container where you can keep data that your program might need. Think this java terminology as a labeled box where you store something important, so you can easily find and use it later. Variables are fundamental in programming because they allow your Java program to remember things, like a user’s input, the result of a calculation, or any other data your program needs to function.
This document provides an overview of object-oriented programming concepts in Java. It discusses what software and programs are, and describes different programming languages including machine language, assembly language, and high-level languages like Java. It then covers object-oriented programming concepts like classes, objects, encapsulation, inheritance, polymorphism, and dynamic binding. The document also discusses the history and development of the Java programming language, its key features like being simple, secure, portable, and its uses in applications.
This document provides an overview of Java programming concepts including:
- Java is an object-oriented programming language that allows writing programs as console applications or applets.
- It discusses Java features like being simple, object-oriented, robust, secure, portable, and supports multithreading.
- Key Java concepts covered are data types, keywords, classes, objects, inheritance, polymorphism and exceptions.
- It also discusses the Java virtual machine architecture, class files, and the basic structure of a Java program.
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...Kuntal Bhowmick
This document contains a bank of multiple choice questions about object oriented programming interfaces. It includes 21 questions about interfaces, each with 4 possible answers, followed by an explanation of the correct answer. The questions cover topics like how interfaces define methods without implementation, how classes implement interfaces, and how interfaces can extend other interfaces.
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...Kuntal Bhowmick
The document contains a collection of multiple choice questions and answers about abstract classes in object-oriented programming. It includes 14 questions that test understanding of key concepts of abstract classes such as: when the abstract keyword is used, defining abstract methods, preventing instantiation of abstract classes, requiring subclasses to implement abstract methods, and preventing inheritance of classes. Each question is presented on an even page with its answer on the adjacent odd page.
Multiple Choice Questions on JAVA (object oriented programming) bank 6 -- inh...Kuntal Bhowmick
This document contains a 20 question multiple choice quiz about object oriented programming concepts related to inheritance. Each question is presented on an even page with the corresponding answer and explanation on the adjacent odd page. The quiz covers topics like superclass vs subclass, method overriding vs hiding, inheritance terminology in Java, and advantages/disadvantages of inheritance. The document instructs readers to first attempt each question before looking at the solution, and suggests viewing it in single page mode for clarity.
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...Kuntal Bhowmick
This document contains 18 multiple choice questions about memory management in object-oriented programming. It provides the questions, possible answers, and explanations for the answers. The questions cover topics like garbage collection, heap fragmentation, advantages and disadvantages of garbage collection, the finalize() method, the this keyword, call by value vs call by reference, final variables and methods, static and nested classes.
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loopsKuntal Bhowmick
1. The document contains 10 multiple choice questions about loops in object oriented programming.
2. Each question is presented on an even page with the solution provided on the adjacent odd page.
3. The questions cover topics like the while loop condition, do-while loop execution, for loop syntax, and the use of break and continue statements.
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...Kuntal Bhowmick
This document contains a 17-page MCQ quiz on object-oriented programming concepts like classes, objects, and conditional statements. It includes 18 multiple choice questions about topics such as the difference between classes and objects, access specifiers, method overloading, constructors, and if statements. Each question is presented on an even page with the corresponding explanation and answer on the adjacent odd page. The document instructs readers to first attempt each question themselves before checking the solution.
Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- bas...Kuntal Bhowmick
This document contains a 20-question multiple choice quiz on basic object-oriented programming concepts in Java. Each question is presented on an even page with possible answer options, while the corresponding solution and explanation is given on the adjacent odd page. The quiz covers fundamental topics like data types, access specifiers, inheritance, polymorphism, and more.
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...Kuntal Bhowmick
This document contains 20 multiple choice questions about object-oriented programming concepts. It provides the questions on adjacent even pages and the answers on adjacent odd pages. Some key concepts covered include encapsulation, inheritance, polymorphism, abstraction, and the differences between Java and C++.
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Kuntal Bhowmick
A Hash table is a data structure used for storing and retrieving data very quickly. Insertion of data in the hash table is based on the key value. Hence every entry in the hash table is associated with some key.
HASHING AND HASH FUNCTIONS, HASH TABLE REPRESENTATION, HASH FUNCTION, TYPES OF HASH FUNCTIONS, COLLISION, COLLISION RESOLUTION, CHAINING, OPEN ADDRESSING – LINEAR PROBING, QUADRATIC PROBING, DOUBLE HASHING
introduction to E-commerce, Electronic commerce, EDI, CS802E,
e-commerce ,edi ,electronic data interchange ,traditional commerce ,buyer and seller ,origin of e-commerce ,business process ,impact of e-commerce ,value chain analysis ,company value chain ,case studies on e-commerce ,advantages of e-commerce ,disadvantages of e-commerce
The Bresenham's line algorithm uses integer calculations to draw lines on a raster display. It works by determining which pixel to plot next along the line based on a decision parameter. The parameter is initially calculated based on the line's slope and endpoints, and then updated as the algorithm moves from pixel to pixel. This allows the algorithm to avoid floating point arithmetic for improved efficiency.
This document discusses various operating system concepts related to processes and threads. It defines key process terms like process state, process control block, and scheduling queues. It describes the different types of scheduling including long term, short term, and medium term scheduling. It also discusses process states like new, ready, running, waiting, and terminated. Process control blocks are described as storing information about the process state, program counter, CPU registers, scheduling, memory management, I/O status, and accounting. Scheduling queues include the job queue, ready queue, and device queues.
This document provides an overview of networking concepts including definitions of key terms like network, link, node, gateway, transmission media, protocols, error detection, and reliable data transmission protocols. It discusses the layers of the OSI model and responsibilities of each layer. Finally, it covers data link layer protocols, framing, flow control, error control techniques like ARQ, and reliable transmission protocols like stop-and-wait and sliding window protocols.
The document contains summaries of several C programming examples:
1. Programs to calculate the area and circumference of a circle, find simple interest, convert temperatures between Celsius and Fahrenheit, calculate subject marks and percentages, and calculate gross salary.
2. Additional programs demonstrate swapping values with and without a third variable, finding the greatest of three numbers, determining if a year is a leap year, and identifying integers as odd or even, positive or negative.
3. Further programs check if an integer is divisible by 5 and 11, compare two integers for equality, use a switch statement to print days of the week, and perform arithmetic operations using a switch case.
This document outlines 75 programming assignments covering fundamental C programming concepts like loops, arrays, pointers, strings, functions, structures, unions, and file handling. Students are instructed to only code the programs marked with asterisks in their lab assignment. The document provides the assignment questions, descriptions and page numbers. It also includes a link and QR code for online access to the file containing the full assignment details.
This document provides an introduction to programming and some key skills needed. It discusses a simplified model of programming using a calculator to perform tasks like calculating an average. It notes computers require precise instructions and details everything. The document outlines four key skills: attention to detail, thinking like a "stupid" computer, good memory, and ability to think abstractly on several levels by compartmentalizing tasks. Real programming requires care, craftsmanship and managing complexity through abstraction.
Fluid mechanics is the branch of physics concerned with the mechanics of fluids (liquids, gases, and plasmas) and the forces on them. Originally applied to water (hydromechanics), it found applications in a wide range of disciplines, including mechanical, aerospace, civil, chemical, and biomedical engineering, as well as geophysics, oceanography, meteorology, astrophysics, and biology.
It can be divided into fluid statics, the study of various fluids at rest, and fluid dynamics.
Fluid statics, also known as hydrostatics, is the study of fluids at rest, specifically when there's no relative motion between fluid particles. It focuses on the conditions under which fluids are in stable equilibrium and doesn't involve fluid motion.
Fluid kinematics is the branch of fluid mechanics that focuses on describing and analyzing the motion of fluids, such as liquids and gases, without considering the forces that cause the motion. It deals with the geometrical and temporal aspects of fluid flow, including velocity and acceleration. Fluid dynamics, on the other hand, considers the forces acting on the fluid.
Fluid dynamics is the study of the effect of forces on fluid motion. It is a branch of continuum mechanics, a subject which models matter without using the information that it is made out of atoms; that is, it models matter from a macroscopic viewpoint rather than from microscopic.
Fluid mechanics, especially fluid dynamics, is an active field of research, typically mathematically complex. Many problems are partly or wholly unsolved and are best addressed by numerical methods, typically using computers. A modern discipline, called computational fluid dynamics (CFD), is devoted to this approach. Particle image velocimetry, an experimental method for visualizing and analyzing fluid flow, also takes advantage of the highly visual nature of fluid flow.
Fundamentally, every fluid mechanical system is assumed to obey the basic laws :
Conservation of mass
Conservation of energy
Conservation of momentum
The continuum assumption
For example, the assumption that mass is conserved means that for any fixed control volume (for example, a spherical volume)—enclosed by a control surface—the rate of change of the mass contained in that volume is equal to the rate at which mass is passing through the surface from outside to inside, minus the rate at which mass is passing from inside to outside. This can be expressed as an equation in integral form over the control volume.
The continuum assumption is an idealization of continuum mechanics under which fluids can be treated as continuous, even though, on a microscopic scale, they are composed of molecules. Under the continuum assumption, macroscopic (observed/measurable) properties such as density, pressure, temperature, and bulk velocity are taken to be well-defined at "infinitesimal" volume elements—small in comparison to the characteristic length scale of the system, but large in comparison to molecular length scale
In tube drawing process, a tube is pulled out through a die and a plug to reduce its diameter and thickness as per the requirement. Dimensional accuracy of cold drawn tubes plays a vital role in the further quality of end products and controlling rejection in manufacturing processes of these end products. Springback phenomenon is the elastic strain recovery after removal of forming loads, causes geometrical inaccuracies in drawn tubes. Further, this leads to difficulty in achieving close dimensional tolerances. In the present work springback of EN 8 D tube material is studied for various cold drawing parameters. The process parameters in this work include die semi-angle, land width and drawing speed. The experimentation is done using Taguchi’s L36 orthogonal array, and then optimization is done in data analysis software Minitab 17. The results of ANOVA shows that 15 degrees die semi-angle,5 mm land width and 6 m/min drawing speed yields least springback. Furthermore, optimization algorithms named Particle Swarm Optimization (PSO), Simulated Annealing (SA) and Genetic Algorithm (GA) are applied which shows that 15 degrees die semi-angle, 10 mm land width and 8 m/min drawing speed results in minimal springback with almost 10.5 % improvement. Finally, the results of experimentation are validated with Finite Element Analysis technique using ANSYS.
Analysis of reinforced concrete deep beam is based on simplified approximate method due to the complexity of the exact analysis. The complexity is due to a number of parameters affecting its response. To evaluate some of this parameters, finite element study of the structural behavior of the reinforced self-compacting concrete deep beam was carried out using Abaqus finite element modeling tool. The model was validated against experimental data from the literature. The parametric effects of varied concrete compressive strength, vertical web reinforcement ratio and horizontal web reinforcement ratio on the beam were tested on eight (8) different specimens under four points loads. The results of the validation work showed good agreement with the experimental studies. The parametric study revealed that the concrete compressive strength most significantly influenced the specimens’ response with the average of 41.1% and 49 % increment in the diagonal cracking and ultimate load respectively due to doubling of concrete compressive strength. Although the increase in horizontal web reinforcement ratio from 0.31 % to 0.63 % lead to average of 6.24 % increment on the diagonal cracking load, it does not influence the ultimate strength and the load-deflection response of the beams. Similar variation in vertical web reinforcement ratio leads to an average of 2.4 % and 15 % increment in cracking and ultimate load respectively with no appreciable effect on the load-deflection response.
its all about Artificial Intelligence(Ai) and Machine Learning and not on advanced level you can study before the exam or can check for some information on Ai for project
Value Stream Mapping Worskshops for Intelligent Continuous SecurityMarc Hornbeek
This presentation provides detailed guidance and tools for conducting Current State and Future State Value Stream Mapping workshops for Intelligent Continuous Security.
☁️ GDG Cloud Munich: Build With AI Workshop - Introduction to Vertex AI! ☁️
Join us for an exciting #BuildWithAi workshop on the 28th of April, 2025 at the Google Office in Munich!
Dive into the world of AI with our "Introduction to Vertex AI" session, presented by Google Cloud expert Randy Gupta.
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...Infopitaara
A Boiler Feed Pump (BFP) is a critical component in thermal power plants. It supplies high-pressure water (feedwater) to the boiler, ensuring continuous steam generation.
⚙️ How a Boiler Feed Pump Works
Water Collection:
Feedwater is collected from the deaerator or feedwater tank.
Pressurization:
The pump increases water pressure using multiple impellers/stages in centrifugal types.
Discharge to Boiler:
Pressurized water is then supplied to the boiler drum or economizer section, depending on design.
🌀 Types of Boiler Feed Pumps
Centrifugal Pumps (most common):
Multistage for higher pressure.
Used in large thermal power stations.
Positive Displacement Pumps (less common):
For smaller or specific applications.
Precise flow control but less efficient for large volumes.
🛠️ Key Operations and Controls
Recirculation Line: Protects the pump from overheating at low flow.
Throttle Valve: Regulates flow based on boiler demand.
Control System: Often automated via DCS/PLC for variable load conditions.
Sealing & Cooling Systems: Prevent leakage and maintain pump health.
⚠️ Common BFP Issues
Cavitation due to low NPSH (Net Positive Suction Head).
Seal or bearing failure.
Overheating from improper flow or recirculation.
Concept of Problem Solving, Introduction to Algorithms, Characteristics of Algorithms, Introduction to Data Structure, Data Structure Classification (Linear and Non-linear, Static and Dynamic, Persistent and Ephemeral data structures), Time complexity and Space complexity, Asymptotic Notation - The Big-O, Omega and Theta notation, Algorithmic upper bounds, lower bounds, Best, Worst and Average case analysis of an Algorithm, Abstract Data Types (ADT)
How to use nRF24L01 module with ArduinoCircuitDigest
Learn how to wirelessly transmit sensor data using nRF24L01 and Arduino Uno. A simple project demonstrating real-time communication with DHT11 and OLED display.
1. Page 1 of 11
Class Notes on Basic concepts of OOP (Part - 2)
Contents:-Class & Object Overview Basic concepts of Java programming-advantages of Java, byte-code & JVM,
data types, Basic idea of inheritance, encapsulation, polymorphism, How to compile and execute Java
Programs
Class
In object-oriented programming, a class is a construct that is used to create instances of itself – referred to as
class instances, class objects, instance objects or simply objects. A class defines constituent members which
enable its instances to have state and behavior. Data field members (member variables or instance variables)
enable a class instance to maintain state. Other kinds of members, especially methods, enable the behavior of
class instances. Classes define the type of their instances.
Objects
An object is a location in memory having a value and referenced by an identifier. An object can be a variable,
function, or data structure. With the introduction of object-oriented programming the same word, "object,"
refers to a particular instance of a class.
Basic concepts of Java Programming
Java platform overview
Java technology is used to develop applications for a wide range of environments, from consumer devices to
heterogeneous enterprise systems.
Like any programming language, the Java language has its own structure, syntax rules, and programming
paradigm. The Java language's programming paradigm is based on the concept of object-oriented
programming (OOP), which the language's features support.
The Java language is a C-language derivative, so its syntax rules look much like C's: for example, code blocks
are modularized into methods and delimited by braces ({and }), and variables are declared before they are
used.
The java Compiler
When you program for the Java platform, you write source code in .java files and then compile them. The
compiler checks your code against the language's syntax rules, then writes out bytecodes in .class files.
Bytecodes are standard instructions targeted to run on a Java virtual machine (JVM). In adding this level of
abstraction, the Java compiler differs from other language compilers, which write out instructions suitable for
the CPU chipset the program will run on.
2. Page 2 of 11
The JVM
At run time, the JVM reads and interprets .class files and executes the program's instructions on the native
hardware platform for which the JVM was written. The JVM interprets the bytecodes just as a CPU would
interpret assembly-language instructions. The difference is that the JVM is a piece of software written
specifically for a particular platform. The JVM is the heart of the Java language's "write-once, run-anywhere"
principle. Your code can run on any chipset for which a suitable JVM implementation is available. JVMs are
available for major platforms like Linux and Windows, and subsets of the Java language have been
implemented in JVMs for mobile phones and hobbyist chips.
The garbage collector
Rather than forcing you to keep up with memory allocation the Java platform provides memory management
out of the box. When your Java application creates an object instance at run time, the JVM automatically
allocates memory space for that object from the heap, which is a pool of memory set aside for your program
to use. The Java garbage collector runs in the background, keeping track of which objects the application no
longer needs and reclaiming memory from them. This approach to memory handling is called implicit memory
management because it doesn't require you to write any memory-handling code. Garbage collection is one of
the essential features of Java platform performance.
The Java Development Kit
When you download a Java Development Kit (JDK), you get — in addition to the compiler and other tools — a
complete class library of prebuilt utilities that help you accomplish just about any task common to application
development.
The Java Runtime Environment
The Java Runtime Environment (JRE; also known as the Java runtime) includes the JVM, code libraries, and
components that are necessary for running programs written in the Java language. It is available for multiple
platforms. You can freely redistribute the JRE with your applications, according to the terms of the JRE license,
to give the application's users a platform on which to run your software. The JRE is included in the JDK.
Object-oriented programming concepts
The Java language is object-oriented. If you haven't used an object-oriented language before, its concepts
might seem strange at first. This section is a short introduction to OOP language concepts, using structured
programming as a point of contrast.
What is an object?
Structured programming languages like C and COBOL follow a very different programming paradigm from
object-oriented ones. The structured-programming paradigm is highly data-oriented, which means that you
3. Page 3 of 11
have data structures on one hand, and then program instructions that act on that data. Object-oriented
languages like the Java language combine data and program instructions into objects.
An object is a self-contained entity that contains attributes and behavior, and nothing more. Rather than
having a data structure with fields (attributes) and passing that structure around to all of the program logic
that acts on it (behavior), in an object-oriented language, data and program logic are combined. This
combination can occur at vastly different levels of granularity, from fine-grained objects like a Number, to
coarse-grained objects such as a Funds Transfer service in a large banking application.
Parent and child objects
A parent object is one that serves as the structural basis for deriving more-complex child objects. A child object
looks like its parent but is more specialized. The object-oriented paradigm allows you to reuse the common
attributes and behavior of the parent object, adding to its child objects attributes and behavior that differ.
Object communication and coordination
Objects talk to other objects by sending messages (method calls in the Java language). Furthermore, in an
object-oriented application, program code coordinates the activities among objects to perform tasks within
the context of the given application domain.
Object summary
A well-written object:
Has crisp boundaries
Does a finite set of activities
Knows only about its data and any other objects that it needs to accomplish its activities
In essence, an object is a discrete entity that has only the necessary dependencies on other objects to perform
its tasks. Now you'll see what an object looks like.
The Person object
I'll start with an example that is based on a common application-development scenario: an individual being
represented by a Person object.
Going back to the definition of an object, you know that an object has two primary elements: attributes and
behavior. You'll see how these apply to the Person object.
Attributes
What attributes can a person have? Some common ones include:
Name
Age
Height
Weight
Eye color
Gender
4. Page 4 of 11
You can probably think of more (and you can always add more attributes later), but this list is a good start.
Behavior
An actual person can do all sorts of things, but object behaviors usually relate to some kind of application
context. In a business-application context, for instance, you might want to ask your Person object, "What is
your age?" In response, Person would tell you the value of its Age attribute.
More-complex logic could be hidden inside of the Person object, but for now suppose that Person has the
behavior of answering these questions:
What is your name?
What is your age?
What is your height?
What is your weight?
What is your eye color?
What is your gender?
State and string
State is an important concept in OOP. An object's state is represented at any moment in time by the value of
its attributes.
In the case of Person, its state is defined by attributes such as name, age, height, and weight. If you wanted to
present a list of several of those attributes, you might do sousing a String class, which I'll talk more about later
in the class.
Together, the concepts of state and string allow you to say to Person: tell me who you are by giving me a
listing (or String) of your attributes.
Principles of OOP using JAVA
If you come from a structured-programming background, the OOP value proposition might not be clear yet.
After all, the attributes of a person and any logic to retrieve (and convert) their values could be written in C.
This section clarifies the benefits of the OOP paradigm by explaining its defining principles: encapsulation,
inheritance, and polymorphism.
Encapsulation
Recall that an object is above all discrete, or self-contained. This is the principle of encapsulation at work.
Hiding is another term that is sometimes used to express the self-contained, protected nature of objects.
Regardless of terminology, what's important is that the object maintains a boundary between its state and
behavior, and the outside world. Like objects in the real world, objects used in computer programming have
various types of relationships with different categories of objects in the applications that use them.
On the Java platform, you can use access specifiers (which I'll introduce later in the class) to vary the nature of
object relationships from public to private. Public access is wide open, whereas private access means the
object's attributes are accessible only within the object itself.
The public/private boundary enforces the object-oriented principle of encapsulation. On the Java platform,
you can vary the strength of that boundary on an object-by-object basis, depending on a system of trust.
Encapsulation is a powerful feature of the Java language.
Inheritance
5. Page 5 of 11
In structured programming, it is common to copy a structure, give it a new name, and add or modify the attributes
that make the new entity (such as an Account record) different from its original source. Over time, this approach
generates a great deal of duplicated code, which can create maintenance issues.
OOP introduces the concept of inheritance, whereby specialized objects — without additional code — can "copy"
the attributes and behavior of the source objects they specialize. If some of those attributes or behaviors need to
change, then you simply override them. You only change what you need to change in order to create specialized
objects. As you know from the Object-oriented programming concepts section, the source object is called the
parent, and the new specialization is called the child.
Inheritance at work
Suppose you are writing a human-resources application and want to use the Person object as the basis for a
new object called Employee. Being the child of Person, Employee would have all of the attributes of a Person
object, along with additional ones, such as:
Taxpayer identification number
Hire date
Salary
Inheritance makes it easy to create the new Employee class of the object without needing to copy all of the
Person code manually or maintain it.
You'll see plenty of examples of inheritance in Java programming later in the class and in my class notes.
Polymorphism
Polymorphism is a harder concept to grasp than encapsulation and inheritance. In essence, it means that
objects that belong to the same branch of a hierarchy, when sent the same message (that is, when told to do
the same thing), can manifest that behavior differently.
To understand how polymorphism applies to a business-application context, return to the Person example.
Remember telling Person to format its attributes into a String? Polymorphism makes it possible for Person to
represent its attributes in a variety of ways depending on the type of Person it is.
Polymorphism is one of the more complex concepts you'll encounter in OOP on the Java platform and not
within the scope of an introductory tutorial.
Advantages of JAVA
JAVA offers a number of advantages to developers.
Java is simple: Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn
than other programming languages. The reason that why Java is much simpler than C++ is because Java uses
automatic memory allocation and garbage collection where else C++ requires the programmer to allocate
memory and to collect garbage.
Java is object-oriented: Java is object-oriented because programming in Java is centered on creating objects,
manipulating objects, and making objects work together. This allows you to create modular programs and
reusable code.
6. Page 6 of 11
Java is platform-independent: One of the most significant advantages of Java is its ability to move easily from
one computer system to another.
The ability to run the same program on many different systems is crucial to World Wide Web software, and
Java succeeds at this by being platform-independent at both the source and binary levels.
Java is distributed: Distributed computing involves several computers on a network working together. Java is
designed to make distributed computing easy with the networking capability that is inherently integrated into
it.
Writing network programs in Java is like sending and receiving data to and from a file. For example, the
diagram below shows three programs running on three different systems, communicating with each other to
perform a joint task.
Java is interpreted: An interpreter is needed in order to run Java programs. The programs are compiled into
Java Virtual Machine code called bytecode.
The bytecode is machine independent and is able to run on any machine that has a Java interpreter. With
Java, the program need only be compiled once, and the bytecode generated by the Java compiler can run on
any platform.
Java is secure: Java is one of the first programming languages to consider security as part of its design. The
Java language, compiler, interpreter, and runtime environment were each developed with security in mind.
Java is robust: Robust means reliable and no programming language can really assure reliability. Java puts a
lot of emphasis on early checking for possible errors, as Java compilers are able to detect many problems that
would first show up during execution time in other languages.
Java is multithreaded: Multithreaded is the capability for a program to perform several tasks simultaneously
within a program. In Java, multithreaded programming has been smoothly integrated into it, while in other
languages, operating system-specific procedures have to be called in order to enable multithreading.
Multithreading is a necessity in visual and network programming.
Disadvantages of JAVA
Performance: Java can be perceived as significantly slower and more memory-consuming than natively
compiled languages such as C or C++.
Look and feel: The default look and feel of GUI applications written in Java using the Swing toolk it is very
different from native applications. It is possible to specify a different look and feel through the pluggable look
and feel system of Swing.
Java bytecode
Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode opcode is one
byte in length, although some require parameters, resulting in some multi-byte instructions. A Java
programmer does not need to be aware of or understand Java bytecode at all.
7. Page 7 of 11
Java virtual machine
A Java virtual machine (JVM) is a virtual machine that can execute Java bytecode. It is the code execution
component of the Java platform. Sun Microsystems has stated that there are over 5.5 billion JVM-enabled
devices.
A Java virtual machine is a program which executes certain other programs, namely those containing Java
bytecode instructions. JVMs are most often implemented to run on an existing operating system, but can also
be implemented to run directly on hardware. A JVM provides a run-time environment in which Java bytecode
can be executed, enabling features such as automated exception handling, which provides root-cause
debugging information for every software error (exception). A JVM is distributed along with Java Class Library,
a set of standard class libraries (in Java bytecode) that implement the Java application programming interface
(API). These libraries, bundled together with the JVM, form the Java Runtime Environment (JRE).
JVMs are available for many hardware and software platforms. The use of the same bytecode for all JVMs on
all platforms allows Java to be described as a write once, run anywhere programming language, versus write
once, compile anywhere, which describes cross-platform compiled languages. Thus, the JVM is a crucial
component of the Java platform.
Java bytecode is an intermediate language which is typically compiled from Java, but it can also be compiled
from other programming languages. For example, Ada source code can be compiled to Java bytecode and
executed on a JVM.
Java Basic Data Types
Variables are nothing but reserved memory locations to store values. This means that when you create a
variable you reserve some space in memory.
Based on the data type of a variable, the operating system allocates memory and decides what can be stored
in the reserved memory. Therefore, by assigning different data types to variables, you can store integers,
decimals, or characters in these variables.
There are two data types available in Java:
Primitive Data Types
Reference/Object Data Types
Primitive Data Types
There are eight primitive data types supported by Java. Primitive data types are predefined by the language
and named by a key word. Let us now look into detail about the eight primitive data types.
byte:
Byte data type is a 8-bit signed two's complement integer.
Minimum value is -128 (-2^7)
Maximum value is 127 (inclusive)(2^7 -1)
Default value is 0
8. Page 8 of 11
Byte data type is used to save space in large arrays, mainly in place of integers, since a byte is four
times smaller than an int.
Example : byte a = 100 , byte b = -50
short:
Short data type is a 16-bit signed two's complement integer.
Minimum value is -32,768 (-2^15)
Maximum value is 32,767(inclusive) (2^15 -1)
Short data type can also be used to save memory as byte data type. A short is 2 times smaller than an
int
Default value is 0.
Example : short s= 10000 , short r = -20000
int:
Int data type is a 32-bit signed two's complement integer.
Minimum value is - 2,147,483,648.(-2^31)
Maximum value is 2,147,483,647(inclusive).(2^31 -1)
Int is generally used as the default data type for integral values unless there is a concern about
memory.
The default value is 0.
Example : int a = 100000, int b = -200000
long:
Long data type is a 64-bit signed two's complement integer.
Minimum value is -9,223,372,036,854,775,808.(-2^63)
Maximum value is 9,223,372,036,854,775,807 (inclusive). (2^63 -1)
This type is used when a wider range than int is needed.
Default value is 0L.
Example : int a = 100000L, int b = -200000L
float:
Float data type is a single-precision 32-bit IEEE 754 floating point.
Float is mainly used to save memory in large arrays of floating point numbers.
Default value is 0.0f.
Float data type is never used for precise values such as currency.
Example : float f1 = 234.5f
double:
double data type is a double-precision 64-bit IEEE 754 floating point.
This data type is generally used as the default data type for decimal values. generally the default
choice.
Double data type should never be used for precise values such as currency.
Default value is 0.0d.
9. Page 9 of 11
Example : double d1 = 123.4
boolean:
boolean data type represents one bit of information.
There are only two possible values : true and false.
This data type is used for simple flags that track true/false conditions.
Default value is false.
Example : boolean one = true
char:
char data type is a single 16-bit Unicode character.
Minimum value is 'u0000' (or 0).
Maximum value is 'uffff' (or 65,535 inclusive).
Char data type is used to store any character.
Example . char letterA ='A'
Reference Data Types:
Reference variables are created using defined constructors of the classes. They are used to access
objects. These variables are declared to be of a specific type that cannot be changed. For example,
Employee, Puppy etc.
Class objects, and various type of array variables come under reference data type.
Default value of any reference variable is null.
A reference variable can be used to refer to any object of the declared type or any compatible type.
Example : Animal animal = new Animal("giraffe");
Java Literals:
A literal is a source code representation of a fixed value. They are represented directly in the code without any
computation.
Literals can be assigned to any primitive type variable. For example:
byte a = 68;
char a = 'A'
byte, int, long, and short can be expressed in decimal(base 10),hexadecimal(base 16) or octal(base 8) number
systems as well.
Prefix 0 is used to indicates octal and prefix 0x indicates hexadecimal when using these number systems for
literals. For example:
int decimal = 100;
int octal = 0144;
int hexa = 0x64;
String literals in Java are specified like they are in most other languages by enclosing a sequence of characters
between a pair of double quotes. Examples of string literals are:
10. Page 10 of 11
"Hello World"
"twonlines"
""This is in quotes""
String and char types of literals can contain any Unicode characters. For example:
char a = 'u0001';
String a = "u0001";
Java language supports few special escape sequences for String and char literals as well. They are:
Notation Character represented
n Newline (0x0a)
r Carriage return (0x0d)
f Formfeed (0x0c)
b Backspace (0x08)
s Space (0x20)
t tab
" Double quote
' Single quote
backslash
ddd Octal character (ddd)
uxxxx Hexadecimal UNICODE character (xxxx)
A Simple Java Program
Now that the basic object-oriented underpinning of Java has been discussed, let’s look at some actual Java
programs. Let’s start by compiling and running the short sample program shown here. As you will see, this
involves a little more work than you might imagine.
/*
This is a simple Java program.
Call this file "Example.java".
*/
class Example {
// Your program begins with a call to main().
public static void main(String args[]) {
System.out.println("This is a simple Java program.");
}
}
About the Program
For most computer languages, the name of the file that holds the source code to a program is arbitrary.
However, this is not the case with Java. The first thing that you must learn about Java is that the name you
give to a source file is very important. For this example, the name of the source file should be Example.java.
Let’s see why? In Java, a source file is officially called a compilation unit. It is a text file that contains one or
more class definitions. The Java compiler requires that a source file use the .java filename extension. Notice
that the file extension is four characters long. As you might guess, your operating system must be capable of
supporting long filenames. This means that DOS and Windows 3.1 are not capable of supporting Java.
However, Windows 95/98 and Windows NT/2000/XP work just fine. As you can see by looking at the program,
11. Page 11 of 11
the name of the class defined by the program is also Example. This is not a coincidence. In Java, all code must
reside inside a class. By convention, the name of that class should match the name of the file that holds the
program. You should also make sure that the capitalization of the filename matches the class name. The
reason for this is that Java is case-sensitive. At this point, the convention that filenames correspond to class
names may seem arbitrary. However, this convention makes it easier to maintain and organize your programs.
Compiling the Program
To compile the Example program, execute the compiler, javac, specifying the name of the source file on the
command line, as shown here:
C:>javac Example.java
The javac compiler creates a file called Example.class that contains the bytecode version of the program. As
discussed earlier, the Java bytecode is the intermediate representation of your program that contains
instructions the Java interpreter will execute. Thus, the output of javac is not code that can be directly
executed. To actually run the program, you must use the Java interpreter, called java. To do so, pass the class
name Example as a command-line argument, as shown here:
C:>java Example
When the program is run, the following output is displayed:
This is a simple Java program.
When Java source code is compiled, each individual class is put into its own output file named after the class
and using the .class extension. This is why it is a good idea to give your Java source files the same name as the
class they contain—the name of the source file will match the name of the .class file. When you execute the
Java interpreter as just shown, you are actually specifying the name of the class that you want the interpreter
to execute. It will automatically search for a file by that name that has the .class extension. If it finds the file, it
will execute the code contained in the specified class.