Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

CO_IF_22412_CO1

Ms. Yogita Jore, Head of Information Technology, Vidyalankar Polytechnic

Date: 03rd February 2021

Learning at your doorstep


Unit 1:
Basic Syntactical constructs in Java

Written by

Yogita Jore
Head, Department of Information Technology (NBA Accredited),
Vidyalankar Polytechnic, Mumbai
Unit Outcome 1:
Write a program to create classes and
objects for the given problem.
Learning Outcome 1b:
Students should understand the
features of java.
What we will learn today –Features of Java

1. Compiled and Interpreted language Key takeaways


Features of java
2. Platform-Independent and Portable

3. Object Oriented

4. Robust and Secure

5. is Distributed

6. Familiar, Simple and Small Yogita Jore


Head, Department of Information Technology (NBA Accredited), Vidyalankar Polytechnic,
7. Multithreaded and Interactive Mumbai

8. High Performance

9. Dynamic

10. Architecture Neutral

11. popular for Internet


Page 5 Maharashtra State Board of Technical Education
Concept Map

Page 6 Maharashtra State Board of Technical Education


Learning Objective/ Key learning

► Features of java

Page 7 Maharashtra State Board of Technical Education


Features of java: Java is Compiled and Interpreted language.

 Java is a two stage system: In a first stage java compiler translates source code into byte code
instructions.
 Byte codes are not machine instructions.
 In a second stage, Java interpreter generates machine code that can be directly executed by the
machine.
 The two steps of compilation and interpretation allow for extensive code checking and improved
security.

Page 8 Maharashtra State Board of Technical Education


Features of java: Java is Platform-Independent and Portable language.

 The feature “Write-once-run-anywhere” (known as the Platform independent) states that programs
written on one platform can run on any platform provided the platform must have the JVM.
 Unlike other programming languages such as C, C++ etc. which are compiled into platform specific
machines.
 On compilation Java program is compiled into bytecode.
 This bytecode is platform independent and can be run on any machine, plus this bytecode format also
provide security.
 Any machine with Java Runtime Environment can run Java Programs.

Page 9 Maharashtra State Board of Technical Education


Features of java: Java is an 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 use in our programs by
inheritance.
 Everything in java is object even the primitive data types can also be converted into object by using the
wrapper class.
 Basic concepts of OOPs are:
 Object
 Class
 Inheritance
 Polymorphism
 Abstraction
 Encapsulation

Page 10 Maharashtra State Board of Technical Education


Features of java: Java is Robust and Secure language.

 Robust simply means strong.


 Java is robust because:
• It uses strong memory management.
• There is a lack of pointers that avoids security problems.
• There is automatic garbage collection in java which runs on the Java Virtual Machine to get rid
of objects which are not being used by a Java application anymore.
• There are exception handling and the type checking mechanism in Java. All these points make
Java robust.
 When it comes to security, Java is always the first choice.
 Java program always runs in Java runtime environment with almost null interaction with system OS,
hence it is more secure.

Page 11 Maharashtra State Board of Technical Education


Features of java: Java is Distributed language.

 Java is a distributed language.


 Programs can be designed to run on computer networks.
 Java has a special class library for communicating using TCP/IP protocols.
 Creating network connections is very much easy in Java as compared to C/C++.
 +.

Page 12 Maharashtra State Board of Technical Education


Features of java: Java is Familiar, Simple and Small language.

 Java is designed to be easy to learn.


 If you understand the basic concept of OOP java would be easy to master.
 There are various features that make the java as a simple language.
 Programs are easy to write and debug because java does not use the pointers explicitly.
 It is much harder to write the java programs that can crash the system but we cannot say about the
other programming languages.
 Java provides the bug free system due to the strong memory management. It also has the automatic
memory allocation and deallocation system.
 It also eliminates operator overloading and multiple inheritance.
 Java uses many Constructs of C and C++ and therefore Java code "looks like a C++" code. Thus Java is
Simplified version of C++.

Page 13 Maharashtra State Board of Technical Education


Features of java: Java is Multithreaded and Interactive language.

 Multithreading means a single program having different threads executing independently at the same
time. Java supports multithreaded programs.
 Multiple threads execute instructions according to the program code in a process or a program.
Multithreading works the similar way as multiple processes run on one computer.

Page 14 Maharashtra State Board of Technical Education


Features of java: Java is Dynamic language.

 By connecting to the Internet, a user immediately has access to thousands of programs and other
computers.
 During the execution of a program, Java can dynamically load classes that it requires either from the
local hard drive, from another computer on the local area network or from a computer somewhere on
the Internet.

Page 15 Maharashtra State Board of Technical Education


Features of java: Java is Architecture Neutral.

 Compiler generates bytecodes, which have nothing to do with a particular computer architecture, hence
a Java program is easy to interpret on any machine.

Page 16 Maharashtra State Board of Technical Education


Features of java: Java is popular for Internet.

 The main reason why Java is popular on the Internet is that Java offers applets.
 Applets are tiny programs which run inside the browser.
 Before the introduction of applets, the web pages were mostly static.
 After the use of this application, they have become dynamic, making browsing richer.
 Applets are very safe.
 They cannot write to the local hard disk.
 Hence, there is no threat of viruses while surfing the Internet.
 This has made applets (and thereby Java) highly popular on the Internet.
 They also support graphical user interface (GUI).

Page 17 Maharashtra State Board of Technical Education


Problem/ Question Explanation and step by step Solution

Q1:Everything in java is an ______ .


Ans: Object

Q2: Write-once-run-anywhere means


Ans: Platform-Independent

Q3: In a first stage, java compiler translates ______ into byte code instructions.
Ans: Source Code

Page 18 Maharashtra State Board of Technical Education

You might also like