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

Module 1

Uploaded by

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

Module 1

Uploaded by

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

1. What is Just-In-Time compiler or JIT Compiler?

(3)

2. Why Java is said to be a secure programming language?(3)

3. Briefly explain the portable, secure and robust features of java?(3)


4. Explain byte code in java?(3)

5. Explain JRE.(3)
6. Explain JDK.(3)

7. Garbage Collection.(3)
8. Differentiate between Function Oriented Approach and Object oriented approach.(10)

Functional Oriented Design (FOD)


➤In function-oriented design, the system is comprised of many smaller sub-systems
known as functions.
➤These functions are capable of performing significant task in the system
➤Function oriented design inherits some properties of structured design where divide and
conquer methodology is used.
This design mechanism divides the whole system into smaller functions
➤These functional modules can share information among am themselves by means of
information passing and using information available globally.
Eg: Banking process
Here withdraw, Deposit, Transfer are functions and that can be divided in to sub- functions
again.
So, in FOD, the entire problem is divided in to number of functions and those functions are
broken down in to smaller functions and these smaller functions are converted in to
software modules.

Object Oriented Design (OOD)


➤OOD is based on Objects and interaction between the objects
➤Interaction between objects is called message communication.
It involves the designing of Objects, Classes and the relationship between the classes
Consider the previous example of Banking process.
Here, customer, money and account are objects
➤In OOD, implementation of a software based on the concepts of objects.
This approach is very close to the real-world applications

CLASS: A class is a blueprint or prototype from which objects are created.


Encapsulation: The wrapping up of data (variables) and function (methods) into a single
unit (called class) is known as encapsulation.It is also called "information hiding"

ABSTRACTION: Abstraction means displaying only essential information and hiding the
details.
POLYMORPHISM: The word polymorphism means having many forms.
Inheritance: The capability of a class to derive properties and characteristics from another
class is called Inheritance.
Inheritance: The capability of a class to derive properties and characteristics from another
class is called Inheritance.

9. Explain object oriented approach.(14)

OBJECT
• Objects are real-world entities that has their own properties and behavior.
• It has physical existence
• Eg: person, banks, company, customers etc
CLASS
• A class is a blueprint or prototype from which objects are created
• A class is a generalized description of an object.
• An object is an instance of a class
Relationship between Object & Class
• Let's take Human Being as a class.
• My name is John, and I am an instance/object of the class Human Being
• Object has a physical existence while a class is just a logical definition.
Encapsulation
• The wrapping up of data(variables) and function (methods) into a single unit (called
class) is known as encapsulation.
• It is also called "Information hiding"
• Protection of data from accidental corruption
• Flexibility and extensibility of the code and reduction in complexity
• Encapsulation of a class can hide the internal details of how an object does
something
• Encapsulation protects abstraction
ABSTRACTION
• Abstraction means displaying only essential information and hiding the details.
• Data abstraction refers to providing only essential information about the data to
the outside world, hiding the background details or implementation.
• Consider a real-life example of a man driving a car. The man only knows that
pressing the accelerators will increase the speed of the car or applying brakes will
stop the car but he does not know about how on pressing accelerator the speed is
actually increasing, he does not know about the inner mechanism of the car or the
implementation of accelerator, brakes etc in the car. This is what abstraction is.
POLYMORPHISM
• The word polymorphism means having many forms In simple words, we can define
polymorphism as the ability of a message to be displayed in more than one form.
• Eg: A person at the same time can have different characteristic. Like a man at the
same time is a father, a husband, an employee. So the same person posses
different behavior in different situations. This is called polymorphism.
• An operation may exhibit different behaviors in different instances. The behavior
depends upon the types of data used in the operation.
Inheritance
• The capability of a class to derive properties and characteristics from another class
is called Inheritance.
• Inheritance is the process by which objects of one class acquired the properties of
objects of another classes
• Sub Class: The class that inherits properties from another class is called Sub class or
Derived Class.
• Super Class: The class whose properties are inherited by sub class is called Base
Class or Super class.
• Reusability: Inheritance supports the concept of "reusability", i.e. when we want to
create a new class and there is already a class that includes some of the code that
we want, we can derive our new class from the existing class. By doing this, we are
reusing the fields and methods of the existing class.
• Eg: Dog, Cat, Cow can be Derived Class of Animal Base Class.
OR
10. Explain lexical issues in Java .(10)
Java Lexical Issues (Java Tokens)
Tokens
• Java Tokens are the smallest individual building block or smallest unit of a Java
program
• Java program is a collection of different types of tokens, comments, and white
spaces.

Keywords
• A keyword is a reserved word. You cannot use it as a variable name, constant name
etc.
• The meaning of the keywords has already been described to the java compiler.
These meaning cannot be changed.
• Thus, the keywords cannot be used as variable names because that would try to
change the existing meaning of the keyword, which is not allowed.
• Java language has reserved 50 words as keywords.
Identifiers
• Identifiers are the names of variables, methods, classes, packages and interfaces
• Identifier must follow some rules.
• All identifiers must start with either a letter( a to z or A to Z) or currency
character($) or an underscore.
• They must not begin with a digit
Eg: int a; char name;
Constants or Literals
• Constants are fixed values of a particular type of data, which cannot be modified in
a program.
• Java language specifies five major type of literals.
Eg: Integer literal: 100
Floating-point literal: 98.6
Character literal: 's'
String literal: "sample"
Comments

Comment type Meaning


//comment Single-line comments
/comment/ Multi-line comments
/** documentation/ Documentation comments

String

• In java, string is basically an object that represents sequence of char values.

• An array of characters works same as java string.

Eg: char[] ch = ('a','t','n','y','l','a'}; String s = "atnyla";

• Brackets[]: Opening and closing brackets are used as array element reference. These
indicate single and multidimensional subscripts.
• Parentheses(): These special symbols are used to indicate function calls and function
parameters.
• Braces(): These opening and ending curly braces mark the start and
• end of a block of code containing more than one executable statement. semicolon;: It is
used to separate more than one statements like in for loop is separates initialization,
condition, and increment.
• Comma: It is an operator that essentially invokes something called an initialization list.
• asterisk: It is used for multiplication.
• assignment operator : It is used to assign values.
• Period: Used to separate package names from subpackages and classes

11. JAVA BUZZWORDS(14)


Simple
• It's simple and easy to learn if you already know the basic concepts of Object
Oriented Programming.
• C++ programmer can move to JAVA with very little effort to learn.
• Java syntax is based on C++
• Java has removed many complicated and rarely-used features, for example, explicit
pointers, operator overloading, etc.
Object oriented
• Java is true object oriented language. Everything in Java is an object.
• All program code and data reside within objects and classes..
• Java comes with an extensive set of classes, arranged in packages that can be used
in our programs through inheritance.
Distributed
• Java is designed for distributed environment of the Internet. Its used for creating
applications on networks
• Java enables multiple programmers at multiple remote locations to collaborate and
work together on a single project.
Compiled and Interpreted
• Usually a computer language is either compiled or Interpreted. Java combines both
this approach and makes it a two-stage system.
• Compiled: Java enables creation of a cross platform programs by compiling into an
intermediate representation called Java Byte code.
• Interpreted Byte code: is then interpreted, which generates machine code that can
be directly executed by the machine that provides a Java Virtual machine.
Robust
• It provides many features that make the program execute reliably in variety of
environments.
• Java is a strictly typed language. It checks code both at compile time and runtime.
Java takes care of all memory management problems with
• garbage-collection. Java, with the help of exception handling captures all types of
serious errors and eliminates any risk of crashing the system.
Secure
• Java provides a "firewall" between a networked application and your computer.
• When a Java Compatible Web browser is used, downloading can be done safely
without fear of viral infection or malicious intent.
• Java achieves this protection by confining a Java program to the java execution
environment and not allowing it to access other parts of the computer.
Architecture Neutral
• Java language and Java Virtual Machine helped in achieving the goal of "write
once; run anywhere, any time, forever."
• Changes and upgrades in operating systems, processors and system resources will
not force any changes in Java Programs.
Portable
• Java is portable because it facilitates you to carry the Java byte code to any
platform. It doesn't require any implementation.
• Java Provides a way to download programs dynamically to all the various types of
platforms connected to the Internet.
High Performance
• Java performance is high because of the use of byte code.
• The byte code can be easily translated into native machine code.
12. Construct a UML Class diagram for Online Movie Ticket Booking System. The various
entities involved in the system are Admin, Registered User, Visitor / Guest User, Movie,
Book Ticket, Make Payment.(7)

13. Construct a UML. Activity diagram for Food Ordering System, which shows the flows
between the activity of Order, Delivery, Food Item, Category, Payment.(7)

You might also like