This document discusses the evolution of Java programming language. It begins with an introduction to Java, describing it as an object-oriented language suited for internet programming. The document then covers Java's history, key features, environment including development tools and runtime components. It describes Java's portability, security, object-oriented nature and use in a variety of platforms from mobile to servers.
The document discusses various features and constructs of the Java programming language including:
- Java is an object-oriented, simple, platform-independent, secure, robust, and high-performance language.
- The Java Runtime Environment (JRE) provides the runtime platform and Java Development Kit (JDK) includes development tools.
- Java programs are compiled to bytecode that runs on the Java Virtual Machine (JVM) on any platform.
- Core Java constructs include data types, variables, operators, statements, and classes. Primitive data types include numbers, booleans, characters and strings.
1. Java is a popular object-oriented programming language created by James Gosling at Sun Microsystems in 1991.
2. The Java Development Kit (JDK) provides tools for developing Java programs, and includes the Java Runtime Environment (JRE) which allows programs to run on any platform with a Java Virtual Machine (JVM).
3. Key features of Java include being platform independent, secure, robust, and multithreaded. Java code is compiled to bytecode that runs on a JVM, allowing the same code to run on different operating systems.
1. Java is a popular object-oriented programming language created by James Gosling at Sun Microsystems in 1991.
2. The Java Development Kit (JDK) provides tools for developing Java programs, and includes the Java Runtime Environment (JRE) which allows programs to run on various platforms.
3. The JRE contains the Java Virtual Machine (JVM) which interprets Java bytecode to execute programs consistently across different hardware and software environments.
Java is a compiled and interpreted, platform-independent, secure, robust, and object-oriented programming language. It is compiled into bytecode that can run on any Java Virtual Machine (JVM), making programs portable across platforms. The JVM is available on many operating systems, so Java code can run on Windows, Linux, Solaris, or Mac OS. Java uses automatic memory management, exceptions, and avoids many common programming bugs found in other languages like C/C++.
This document provides an overview of key Java programming concepts including data types, classes, inheritance, polymorphism, and the Java architecture. It discusses how Java code is compiled to bytecode and executed by the Java Virtual Machine (JVM) independently of hardware or operating systems, making Java programs platform independent. It also describes the Java Runtime Environment (JRE) and Java Development Kit (JDK) and their roles in developing and running Java applications.
This document provides an introduction to the Java programming language. It discusses that Java is an object-oriented, platform-independent language that was originally developed by Sun Microsystems in 1995. It also outlines some key differences between Java and other languages like C and C++, such as Java's lack of pointers and emphasis on object-oriented features. The document then provides details on compiling and running a simple Java program, and explains the different phases of program creation and execution in Java.
This document provides an introduction and overview of the Java programming language, including its history, features, and components. It discusses how Java was developed in 1995 at Sun Microsystems and introduced as a platform-independent language for general business applications and web-based internet applications. It also summarizes Java's key features like being object-oriented, compiled and interpreted, and portable, as well as its core architecture components like the Java programming language, Java Virtual Machine, and Java API.
Java is a general-purpose, class-based, object-oriented programming language that is designed to be portable and deliver high performance. It achieves portability by compiling Java code to bytecode that runs on the Java Virtual Machine (JVM) which is available for many hardware and software platforms. Key features of Java include being write once, run anywhere, object-oriented, platform independent, simple, secure, robust, multithreaded, and dynamic. Java applications can run on desktops, servers, mobile devices, and other platforms.
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.
Java was developed by James Gosling at Sun Microsystems in 1991. It is a popular, object-oriented programming language that is robust, secure, portable, and high-performance. Java code is compiled to bytecode that runs on a Java Virtual Machine, allowing it to run on any platform. The document discusses Java naming conventions, data types, literals, and control statements. It also provides examples of Java code.
Introduction to Java : Feature to Java, Java Virtual Machine, Differences between C++ and Java,
Part of Java, API Document, Starting a Java Program. Important Classes, Formatting the Output
The document provides an introduction to Java programming including:
- Java is an object-oriented language where programs are written as classes and allows "write once, run anywhere" functionality.
- Key features of Java include being simple, robust, secure, multi-threaded, and dynamically flexible.
- The Java architecture includes the compiler, JVM, JRE and JDK which work together to compile and execute Java code.
- Common Java applications include mobile apps, desktop apps, web apps, games, cloud apps, and IoT apps.
- A basic Java program structure includes documentation, packages, imports, classes, and a main method.
Java was initially developed by Sun Microsystems in 1991 under the name Oak by James Gosling. It was renamed to Java in 1995 due to legal issues. Java is an object-oriented programming language that is platform independent, meaning Java programs can run on any system with a Java virtual machine. Key features of Java include being simple, secure, robust, portable, and having automatic memory management. Java is commonly used to build mobile and web applications.
The document contains notes on Java programming concepts from Unit 1. It defines key terms like platform, Java platform, Java Virtual Machine (JVM), and Java Application Programming Interface (API). It also discusses features of the Java language like being object-oriented, robust, portable, and platform independent. The notes provide examples of Java applications and applets and explain why Java is important for internet programming. It also lists differences between Java and C, describes components of the Java Development Kit (JDK), and covers data types and variables in Java.
The document provides an overview of the Java programming language. It discusses that Java was created by James Gosling at Sun Microsystems in 1995 and the latest version is Java SE 14. It then describes several key concepts and features of Java including: it being object-oriented, simple, secure, platform independent, robust, portable, dynamic, architecture neutral, high performance, multithreaded, and distributed. It also discusses the Java Virtual Machine, Java Runtime Environment, Java Development Kit, and main Java platforms.
The document provides an introduction and history of Java, outlining how it was developed in the 1990s as a platform-independent language by James Gosling at Sun Microsystems, and discusses some key advantages of Java like being object-oriented, portable, robust, and having built-in support for security and multithreading. It also describes the Java Development Kit (JDK) which contains tools for developing Java programs and the Java Runtime Environment (JRE) which allows running of Java applications and includes the Java Virtual Machine.
Java is an object-oriented programming language that was initially developed by James Gosling at Sun Microsystems in 1991. It is free to use, runs on all platforms, and is widely used for both desktop and mobile applications as well as large systems. Java code is compiled to bytecode that runs on a Java Virtual Machine, making Java programs platform independent. Key features of Java include being object-oriented, robust, secure, portable, high performance, and having a simple syntax. Java is commonly used to develop web applications, mobile apps, games, and for big data processing.
This document provides an overview of key Java concepts and technologies. It discusses Java's main characteristics including being simple, object-oriented, portable, platform independent, robust, and secure. It then outlines several Java platforms (J2SE, J2E, J2ME), tools (JDK, JRE), virtual machines (JVM, Java HotSpot), and common APIs and technologies used in Java development.
This document provides an overview of the Java programming language and platform. It discusses Java's origins, characteristics, editions, and components like the JDK, JRE, and JVM. Java is introduced as a simple, secure, robust, and platform-independent language well-suited for client-server web applications and small devices. The document outlines Java's history and evolution from 1995 to present. Key aspects of Java like object-orientation, portability, and multi-threading are summarized.
This document provides an overview of variables and their scope in Java. It discusses the three types of variables in Java: local variables, instance variables, and class (static) variables.
Local variables are declared within methods, constructors, or blocks and can only be accessed within their declaration scope. Instance variables are declared within a class but outside of methods and can be accessed using an object reference. Class variables are declared with the static keyword, belong to the class itself rather than any object, and are accessed via the class name. The document provides examples and discusses default variable initialization.
Java is an object-oriented programming language that is platform independent. It was developed by Sun Microsystems, now owned by Oracle. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM), allowing it to run on any device that supports a JVM. Java supports features like inheritance, polymorphism, and encapsulation. It is widely used for client-side applications like applets and server-side applications like servlets and Java Server Pages (JSP). The main Java editions are Java SE for desktop applications, Java EE for enterprise applications, and Java ME for mobile applications.
Java is an object-oriented programming language that is platform independent. It was developed by Sun Microsystems, now owned by Oracle. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM), allowing it to run on any device with a JVM. Java supports features like inheritance, polymorphism, and encapsulation. It is widely used for client-side applications like applets and server-side applications like servlets and Java Server Pages (JSP). The main Java editions are Java SE for desktop applications, Java EE for enterprise applications, and Java ME for mobile applications.
this slide contains about basic introduction of java.it will be helpful for a java beginner. it also useful for java lecture course in your versity.programming with java is very essential for every student.this silde may help you to progress your skill & lernt abc about java.
this slide is about java introductory.it will be helpful for you to know abc of jaba.it also be helpful for u in your versity java course.programming with java is very important for every student.java freshers can grabbed it easily
この資料は、Roy FieldingのREST論文(第5章)を振り返り、現代Webで誤解されがちなRESTの本質を解説しています。特に、ハイパーメディア制御やアプリケーション状態の管理に関する重要なポイントをわかりやすく紹介しています。
This presentation revisits Chapter 5 of Roy Fielding's PhD dissertation on REST, clarifying concepts that are often misunderstood in modern web design—such as hypermedia controls within representations and the role of hypermedia in managing application state.
Ad
More Related Content
Similar to 2 22CA026_Advance Java Programming_Data types and Operators.pptx (20)
Java is a general-purpose, class-based, object-oriented programming language that is designed to be portable and deliver high performance. It achieves portability by compiling Java code to bytecode that runs on the Java Virtual Machine (JVM) which is available for many hardware and software platforms. Key features of Java include being write once, run anywhere, object-oriented, platform independent, simple, secure, robust, multithreaded, and dynamic. Java applications can run on desktops, servers, mobile devices, and other platforms.
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.
Java was developed by James Gosling at Sun Microsystems in 1991. It is a popular, object-oriented programming language that is robust, secure, portable, and high-performance. Java code is compiled to bytecode that runs on a Java Virtual Machine, allowing it to run on any platform. The document discusses Java naming conventions, data types, literals, and control statements. It also provides examples of Java code.
Introduction to Java : Feature to Java, Java Virtual Machine, Differences between C++ and Java,
Part of Java, API Document, Starting a Java Program. Important Classes, Formatting the Output
The document provides an introduction to Java programming including:
- Java is an object-oriented language where programs are written as classes and allows "write once, run anywhere" functionality.
- Key features of Java include being simple, robust, secure, multi-threaded, and dynamically flexible.
- The Java architecture includes the compiler, JVM, JRE and JDK which work together to compile and execute Java code.
- Common Java applications include mobile apps, desktop apps, web apps, games, cloud apps, and IoT apps.
- A basic Java program structure includes documentation, packages, imports, classes, and a main method.
Java was initially developed by Sun Microsystems in 1991 under the name Oak by James Gosling. It was renamed to Java in 1995 due to legal issues. Java is an object-oriented programming language that is platform independent, meaning Java programs can run on any system with a Java virtual machine. Key features of Java include being simple, secure, robust, portable, and having automatic memory management. Java is commonly used to build mobile and web applications.
The document contains notes on Java programming concepts from Unit 1. It defines key terms like platform, Java platform, Java Virtual Machine (JVM), and Java Application Programming Interface (API). It also discusses features of the Java language like being object-oriented, robust, portable, and platform independent. The notes provide examples of Java applications and applets and explain why Java is important for internet programming. It also lists differences between Java and C, describes components of the Java Development Kit (JDK), and covers data types and variables in Java.
The document provides an overview of the Java programming language. It discusses that Java was created by James Gosling at Sun Microsystems in 1995 and the latest version is Java SE 14. It then describes several key concepts and features of Java including: it being object-oriented, simple, secure, platform independent, robust, portable, dynamic, architecture neutral, high performance, multithreaded, and distributed. It also discusses the Java Virtual Machine, Java Runtime Environment, Java Development Kit, and main Java platforms.
The document provides an introduction and history of Java, outlining how it was developed in the 1990s as a platform-independent language by James Gosling at Sun Microsystems, and discusses some key advantages of Java like being object-oriented, portable, robust, and having built-in support for security and multithreading. It also describes the Java Development Kit (JDK) which contains tools for developing Java programs and the Java Runtime Environment (JRE) which allows running of Java applications and includes the Java Virtual Machine.
Java is an object-oriented programming language that was initially developed by James Gosling at Sun Microsystems in 1991. It is free to use, runs on all platforms, and is widely used for both desktop and mobile applications as well as large systems. Java code is compiled to bytecode that runs on a Java Virtual Machine, making Java programs platform independent. Key features of Java include being object-oriented, robust, secure, portable, high performance, and having a simple syntax. Java is commonly used to develop web applications, mobile apps, games, and for big data processing.
This document provides an overview of key Java concepts and technologies. It discusses Java's main characteristics including being simple, object-oriented, portable, platform independent, robust, and secure. It then outlines several Java platforms (J2SE, J2E, J2ME), tools (JDK, JRE), virtual machines (JVM, Java HotSpot), and common APIs and technologies used in Java development.
This document provides an overview of the Java programming language and platform. It discusses Java's origins, characteristics, editions, and components like the JDK, JRE, and JVM. Java is introduced as a simple, secure, robust, and platform-independent language well-suited for client-server web applications and small devices. The document outlines Java's history and evolution from 1995 to present. Key aspects of Java like object-orientation, portability, and multi-threading are summarized.
This document provides an overview of variables and their scope in Java. It discusses the three types of variables in Java: local variables, instance variables, and class (static) variables.
Local variables are declared within methods, constructors, or blocks and can only be accessed within their declaration scope. Instance variables are declared within a class but outside of methods and can be accessed using an object reference. Class variables are declared with the static keyword, belong to the class itself rather than any object, and are accessed via the class name. The document provides examples and discusses default variable initialization.
Java is an object-oriented programming language that is platform independent. It was developed by Sun Microsystems, now owned by Oracle. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM), allowing it to run on any device that supports a JVM. Java supports features like inheritance, polymorphism, and encapsulation. It is widely used for client-side applications like applets and server-side applications like servlets and Java Server Pages (JSP). The main Java editions are Java SE for desktop applications, Java EE for enterprise applications, and Java ME for mobile applications.
Java is an object-oriented programming language that is platform independent. It was developed by Sun Microsystems, now owned by Oracle. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM), allowing it to run on any device with a JVM. Java supports features like inheritance, polymorphism, and encapsulation. It is widely used for client-side applications like applets and server-side applications like servlets and Java Server Pages (JSP). The main Java editions are Java SE for desktop applications, Java EE for enterprise applications, and Java ME for mobile applications.
this slide contains about basic introduction of java.it will be helpful for a java beginner. it also useful for java lecture course in your versity.programming with java is very essential for every student.this silde may help you to progress your skill & lernt abc about java.
this slide is about java introductory.it will be helpful for you to know abc of jaba.it also be helpful for u in your versity java course.programming with java is very important for every student.java freshers can grabbed it easily
この資料は、Roy FieldingのREST論文(第5章)を振り返り、現代Webで誤解されがちなRESTの本質を解説しています。特に、ハイパーメディア制御やアプリケーション状態の管理に関する重要なポイントをわかりやすく紹介しています。
This presentation revisits Chapter 5 of Roy Fielding's PhD dissertation on REST, clarifying concepts that are often misunderstood in modern web design—such as hypermedia controls within representations and the role of hypermedia in managing application state.
Interfacing PMW3901 Optical Flow Sensor with ESP32CircuitDigest
Learn how to connect a PMW3901 Optical Flow Sensor with an ESP32 to measure surface motion and movement without GPS! This project explains how to set up the sensor using SPI communication, helping create advanced robotics like autonomous drones and smart robots.
an insightful lecture on "Loads on Structure," where we delve into the fundamental concepts and principles of load analysis in structural engineering. This presentation covers various types of loads, including dead loads, live loads, as well as their impact on building design and safety. Whether you are a student, educator, or professional in the field, this lecture will enhance your understanding of ensuring stability. Explore real-world examples and best practices that are essential for effective engineering solutions.
A lecture by Eng. Wael Almakinachi, M.Sc.
This research is oriented towards exploring mode-wise corridor level travel-time estimation using Machine learning techniques such as Artificial Neural Network (ANN) and Support Vector Machine (SVM). Authors have considered buses (equipped with in-vehicle GPS) as the probe vehicles and attempted to calculate the travel-time of other modes such as cars along a stretch of arterial roads. The proposed study considers various influential factors that affect travel time such as road geometry, traffic parameters, location information from the GPS receiver and other spatiotemporal parameters that affect the travel-time. The study used a segment modeling method for segregating the data based on identified bus stop locations. A k-fold cross-validation technique was used for determining the optimum model parameters to be used in the ANN and SVM models. The developed models were tested on a study corridor of 59.48 km stretch in Mumbai, India. The data for this study were collected for a period of five days (Monday-Friday) during the morning peak period (from 8.00 am to 11.00 am). Evaluation scores such as MAPE (mean absolute percentage error), MAD (mean absolute deviation) and RMSE (root mean square error) were used for testing the performance of the models. The MAPE values for ANN and SVM models are 11.65 and 10.78 respectively. The developed model is further statistically validated using the Kolmogorov-Smirnov test. The results obtained from these tests proved that the proposed model is statistically valid.
How to Buy Snapchat Account A Step-by-Step Guide.pdfjamedlimmk
Scaling Growth with Multiple Snapchat Accounts: Strategies That Work
Operating multiple Snapchat accounts isn’t just a matter of logging in and out—it’s about crafting a scalable content strategy. Businesses and influencers who master this can turn Snapchat into a lead generation engine.
Key strategies include:
Content Calendars for Each Account – Plan distinct content buckets and themes per account to avoid duplication and maintain variety.
Geo-Based Content Segmentation – Use location-specific filters and cultural trends to speak directly to a region's audience.
Audience Mapping – Tailor messaging for niche segments: Gen Z, urban youth, gamers, shoppers, etc.
Metrics-Driven Storytelling – Use Snapchat Insights to monitor what type of content performs best per account.
Each account should have a unique identity but tie back to a central brand voice. This balance is crucial for brand consistency while leveraging the platform’s creative freedoms.
How Agencies and Creators Handle Bulk Snapchat Accounts
Digital agencies and creator networks often manage dozens—sometimes hundreds—of Snapchat accounts. The infrastructure to support this requires:
Dedicated teams for each cluster of accounts
Cloud-based mobile device management (MDM) systems
Permission-based account access for role clarity
Workflow automation tools (Slack, Trello, Notion) for content coordination
This is especially useful in verticals such as music promotion, event marketing, lifestyle brands, and political outreach, where each campaign needs targeted messaging from different handles.
The Legality and Risk Profile of Bulk Account Operations
If your aim is to operate or acquire multiple Snapchat accounts, understand the risk thresholds:
Personal Use (Low Risk) – One or two accounts for personal and creative projects
Business Use (Medium Risk) – Accounts with aligned goals, managed ethically
Automated Bulk Use (High Risk) – Accounts created en masse or used via bots are flagged quickly
Snapchat uses advanced machine learning detection for unusual behavior, including:
Fast switching between accounts from the same IP
Identical Snap stories across accounts
Rapid follower accumulation
Use of unverified devices or outdated OS versions
To stay compliant, use manual operations, vary behavior, and avoid gray-market account providers.
Smart Monetization Through Multi-Account Snapchat Strategies
With a multi-account setup, you can open doors to diversified monetization:
Affiliate Marketing – Niche accounts promoting targeted offers
Sponsored Content – Brands paying for story placement across multiple profiles
Product Launch Funnels – Segment users by interest and lead them to specific landing pages
Influencer Takeovers – Hosting creators across multiple themed accounts for event buzz
This turns your Snapchat network into a ROI-driven asset instead of a time sink.
Conclusion: Build an Ecosystem, Not Just Accounts
When approached correctly, multiple Snapchat accounts bec
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia
In the world of technology, Jacob Murphy Australia stands out as a Junior Software Engineer with a passion for innovation. Holding a Bachelor of Science in Computer Science from Columbia University, Jacob's forte lies in software engineering and object-oriented programming. As a Freelance Software Engineer, he excels in optimizing software applications to deliver exceptional user experiences and operational efficiency. Jacob thrives in collaborative environments, actively engaging in design and code reviews to ensure top-notch solutions. With a diverse skill set encompassing Java, C++, Python, and Agile methodologies, Jacob is poised to be a valuable asset to any software development team.
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Guru
This PRIZ Academy deck walks you step-by-step through Functional Modeling in Action, showing how Subject-Action-Object (SAO) analysis pinpoints critical functions, ranks harmful interactions, and guides fast, focused improvements. You’ll see:
Core SAO concepts and scoring logic
A wafer-breakage case study that turns theory into practice
A live PRIZ Platform demo that builds the model in minutes
Ideal for engineers, QA managers, and innovation leads who need clearer system insight and faster root-cause fixes. Dive in, map functions, and start improving what really matters.
Autodesk Fusion 2025 Tutorial: User InterfaceAtif Razi
Ad
2 22CA026_Advance Java Programming_Data types and Operators.pptx
1. Java : As a Language
• Java is a simple yet powerful object oriented language that is
used for developing robust mission critical applications
• Java is used for developing two types of applications:
• Standalone applications for servers , desktops
and mobile devices
• Web applications called applets
3. Features of Java
• Simple-syntax is based on C++ (so easier for programmers to learn it after C++). Removed many
confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc.
• Object-Oriented- It is truly object oriented. Everything in java is a class. It supports all the
features of object oriented languages which include: Encapsulation, Data hiding, Data abstraction,
Polymorphism Inheritance. Being an object oriented language, Java is data centric language as
compared to procedural languages which are function/procedure centric.
• Platform independent & Architecture neutral - Java is platform independent and architecture
neutral language. The size of primitives is not dependent on platform or architecture on which
code is written for example size of int in C is dependent on compiler and architecture used by the
machine on which code is written but in java size of int will remain 32 bit whatever be the platform
or architecture of the machine.
5. • Secured- Java is best known for its security. With Java, we can develop virus-free systems. Java is
secured because:
• No explicit pointer
• Java Programs run inside a Java Runtime Environment.
6. How does JRE work?
The JDK and JRE interact with one another to create a sustainable runtime environment that enables
the seamless execution of Java-based applications in virtually any operating system. The following
make up the JRE architecture:
• ClassLoader: The Java ClassLoader dynamically loads all classes necessary to run a Java program.
Since Java classes are only loaded into memory when they're required, the JRE uses ClassLoaders to
automate this process on demand.
• Bytecode verifier: The bytecode verifier ensures the format and accuracy of Java code before it
passes to the interpreter. In the event that code violates system integrity or access rights, the class
will be considered corrupted and won't be loaded.
• Security Manager: It determines what resources a class can access such as reading and writing to
the local disk
• Interpreter: After the bytecode successfully loads, the Java interpreter creates an instance of the
JVM that allows the Java program to be executed natively on the underlying machine.
7. • Robust-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.
• Portable-The code after compilation of java source code can run on any architecture and any
platform with the condition that JVM exits there.
• Dynamic- Java is a dynamic language. It supports dynamic loading of classes. It means classes
are loaded on demand. It also supports functions from its native languages, i.e., C and C++.
• Distributed- Java is distributed because it facilitates users to create distributed applications in Java.
RMI and EJB are used for creating distributed applications. This feature of Java makes us able to
access files by calling the methods from any machine on the internet.
8. • High-performance- Java is faster than other traditional interpreted programming languages
because Java bytecode is "close" to native code. It is still a little bit slower than a compiled language
(e.g., C++). Java is an interpreted language that is why it is slower than compiled languages, e.g., C,
C++, etc.
• Multithreaded- A thread is like a separate program, executing concurrently. We can write Java
programs that deal with many tasks at once by defining multiple threads. The main advantage of
multi-threading is that it doesn't occupy memory for each thread. It shares a common memory
area. Threads are important for multi-media, Web applications, etc.
9. Java Language Specifications:API ,JDK and IDEs
API stands for Application Program Interface. It contains predefined classes and
interfaces for developing Java Programs
Java SE,EE and ME- Java is full fledged and powerful language that can be used in
many ways. It comes in three editions:
Java SE (Standard Edition)- Used to design standalone client-side applications and
applets
Java EE(Enterprise Edition)- Used for developing server side applications such as
Java Servlets and Java Server pages
Java ME( Micro Edition)- Used for developing applications for mobile devices such
as cell phones
10. JDK- There are many versions of Java Standard Edition (SE).
Sun releases each version with a Java development Toolkit
(JDK).
JDK consists of a set of programs for developing and testing
Java programs each of which is invoked from a command
line.
JDK tools
◦ javac---java Compiler
◦ java---java interpreter
◦ javadoc---java documentation
◦ jdb----java debugger
Besides JDK, Java development tools can also be used ( like
NetBeans, Eclipse, Jbuilder, intelliJIDEA and TextPad) that
provide an integrated development Environment (IDEs) for
rapidly developing Java programs.
11. Creating , Compiling and Executing a Java Program
A java program can be written using any of the
editors like notepad.The extension of a java
program is .java
Once the source code is created, it is compiled
using java compiler (javac)
The compiled java code is called the Bytecode and is
platform independent and architecture neutral code.
The extension of Bytecode file is .class
Bytecode is interpreted by JVM to create java
executable file (no extension)
12. Create/Modify Source
Code
Source Code
e.g abc.java
Compile Source Code
e.g javac abc.java
Byte Code
Run ByteCode
e.g java abc
If error
JVM interpreting the Bytecode
If runtime errors
13. JIT (Just In Time Compiler)
Bytecode is one of the most important features of java that
aids in cross-platform execution. Way of converting bytecode
to native machine language for execution has a huge impact on
the speed of it. These Bytecode have to be interpreted or
compiled to proper machine instructions depending on the
instruction set architecture. Moreover these can be directly
executed if the instruction architecture is bytecode based.
Interpreting the bytecode affects the speed of execution.
In order to improve performance, JIT compilers interact with
the Java Virtual Machine (JVM) at run time and compile
suitable bytecode sequences into native machine code.
While using a JIT compiler, the hardware is able to execute
the native code, as compared to having the JVM interpret the
same sequence of bytecode repeatedly and incurring an
overhead for the translation process. This subsequently leads
to performance gains in the execution speed.
14. JIT compiler
The JIT compiler is able to perform certain simple
optimizations while compiling a series of bytecode to native
machine language. Some of these optimizations performed by
JIT compilers are data-analysis, reduction of memory
accesses by register allocation, translation from stack
operations to register operations, elimination of
common sub-expressions etc.
15. A simple Java Program
package package_name //optional
import java.io.* //optional
class Example
{
/* the variables or methods declared outside main and inside the class are called
member variables and member methods */
public static void main(String ar[])
{
System.out.println(“hello”);
}
}
The program will be saved as Example.java
(the name of the saved file should be exactly similar to the class name
containing main())
16. The source code compiled using the command:
javac Example.java (given at coomand prompt)
Once the file is successfully compiled, a .class file with the
same name(Example.class) will be created on the system
To run this file, interpreter is called that interprets the
Bytecode (.class file) created after compilation.The command
for this is:
java Example
17. public static void main(String ar[]){}
public: this is an access specifier that indicates that main() function is
accessible outside the class.Anything that is declared public is accessible
outside the class
static: this modifier specifies that main() function can be called without
instantiating the class.This is essential as the main() is called by
interpreter before any objects are made
void: this specifies that main() does not return a value
main() function takes as argument an array of String class objects .This
array takes values from the command line called command line
arguments
19. Program to swap the values of two variables
class Swap{
public static void main(String ar[])
{
int a, b,temp;
a=12; b=13;
temp=a; a=b; b=temp;
System.out.println(“a= “+a+”b=“+b);
}
}
Save this file as Swap.java
Concatenation operator
that combines a string
with a simple variable
20. Atomic elements of Java
Java programs are a collection of whitespace, identifiers,
comments, literals, operators, separators, and keywords.
Identifiers- Identifiers are used for class names, method
names, and variable names.An identifier may be any sequence
of uppercase and lowercase letters, numbers, underscore
and/or dollar-sign characters.
They must not begin with a number, lest they be confused
with a numeric literal.
◦ Again, Java is case-sensitive
21. Atomic elements of Java
Literals- A constant value in Java is created by using a literal
representation of it.
Comments
There are three types of comments defined by Java.
single-line (//)
multiline. (/* */)
documentation comment. (/** */)
22. Java keywords
There are 49 reserved keywords currently defined in the Java
language .
These keywords, combined with the syntax of the operators
and separators, form the definition of the Java language.These
keywords cannot be used as names for a variable, class, or
method.
In addition to the keywords, Java reserves the following:
true, false, and null. These are values defined by Java.You
may not use these words for the names of variables, classes,
and so on
24. Data Types in Java
Java defines eight simple (or elemental) types of data: byte,
short, int, long, char, float, double, and boolean.These
can be put in four groups:
Integers This group includes byte, short, int, and long,
which are for wholevalued signed numbers.
Floating-point numbers This group includes float and
double, which represent
numbers with fractional precision.
Characters This group includes char, which represents
symbols in a character
set, like letters and numbers.
Boolean This group includes boolean, which is a special
type for representing true/false values.
25. Strings in Java
Unlike other languages, Strings in Java are objects of class String
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
“HelloWorld”
“twonlines”
“”This is in quotes””
26. Integers
Java defines four integer types: byte, short,
int, and long.All of these are signed,
positive and negative values. Java does not
support unsigned, positive-only integers. Many
other computer languages, including C/C++,
support both signed and unsigned integers.
The width and ranges of these integer types
vary widely, as shown in this table:
27. Floating-PointTypes
Floating-point numbers, also known as real
numbers, are used when evaluating expressions
that require fractional precision. For example,
calculations such as square root, or
transcendentals such as sine and cosine, result
in a value whose precision requires a floating-
point type
There are two kinds of floating-point types,
float and double, which represent single-
and double-precision numbers,
respectively.
Their width and ranges are shown here:
29. Characters
In Java, the data type used to store characters
is char. Java uses Unicode to represent
characters. It requires 16 bits. Thus, in Java
char is a 16-bit type. The range of a
char is 0 to 65,536. There are no
negative chars.
30. Booleans
Java has a simple type, called boolean, for
logical values. It can have only one of
two possible values, true or false. This is
the type returned by all relational
operators, such as a < b. boolean is also
the type required by the conditional
expressions that govern the control
statements such as if and for.
31. Integer Literals
Any whole number value is an integer literal.
Examples are 1, 2, 3, and 42. These are all
decimal values, meaning they are describing a
base 10 number.
There are two other bases which can be used
in integer literals, octal (base eight) and
hexadecimal (base 16).
Octal values are denoted in Java by a leading
zero. Normal decimal numbers cannot have a
leading zero. Thus, the seemingly valid value
09 will produce an error from the compiler,
since 9 is outside of octal’s 0 to 7 range.
32. A more common base for numbers used by
programmers is hexadecimal.You signify a
hexadecimal constant with a leading zero-x,
( 0x or 0X).The range of a hexadecimal
digit is 0 to 15, so A through F (or a
through f ) are substituted for 10 through 15.
A long literal is specified by attaching l or L to
the number for example 10l or 10L
33. Floating-Point Literals
Floating-point numbers represent decimal
values with a fractional component.They
can be expressed in either standard or
scientific notation.
Standard notation consists of a whole number
component followed by a decimal point
followed by a fractional component. For
example, 2.0, 3.14159, and 0.6667 represent
valid standard-notation floating-point
numbers.
34. Scientific notation uses a standard-notation,
floating-point number plus a suffix that specifies
a power of 10 by which the number is to be
multiplied. The exponent is indicated by an E
or e followed by a decimal number, which can be
positive or negative. Examples include
6.022E23, 314159E–05, and 2e+100.
Floating-point literals in Java default to
double precision. To specify a float
literal, you must append an F or f to the
constant.You can also explicitly specify a double
literal by appending a D or d. Doing so is, of
course, redundant.
35. The default double type consumes 64 bits of
storage, while the less-accurate float type
requires only 32 bits
Boolean Literals Boolean literals are simple.
There are only two logical values that a
boolean value can have, true and false.
The values of true and false do not
convert into any numerical
representation. The true literal in Java
does not equal 1, nor does the false
literal equal 0. In Java, they can only be
assigned to variables declared as boolean, or
used in expressions with Boolean
36. Character Literals
Characters in Java are indices into the
Unicode character set.They are 16-bit values
that can be converted into integers and
manipulated with the integer operators, such
as the addition and subtraction operators. A
literal character is represented inside a pair of
single quotes. All of the visible ASCII
characters can be directly entered inside the
quotes, such as ‘a’,‘z’, and ‘@’.
37. String Literals
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
“Hello World”
“twonlines”
“”This is in quotes””
38. The Scope and Lifetime ofVariables
Most other computer languages define two general categories of scopes
for variables: global and local. However, these traditional scopes do not fit
well with Java’s strict, object oriented model.
In Java, the two major scopes are those defined by a class and those
defined by a method
The scope defined by a method begins with its opening curly brace.
39. Operators and Assignments
Java operators include the following:
• Unary arithmetic operator
• Binary arithmetic operator
• Bitwise operators
• Shift operators
• Logical operators
• Assignment operator
• The cast operator
• Ternary operator
40. Unary arithmetic operator-
Unary operator perform operations on a single
operand.These are:
increment operator - ++
decrement operator- --
Change the sign of the value- +,-
Unary numeric promotion- If the single operand of the unary operator has a type
narrower than int, it is converted to int by implicit widening primitive conversion,
Applies to byte,char or short values
41. The ++ and -- operators are used to increment and
decrement a value.
++x -----prefix
x++ ----postfix
--x ----prefix
x-- -----postfix
Unary numeric promotion- If the single operand of
the unary operator has a type narrower than int, it
is converted to int by implicit widening primitive
conversion, otherwise it is not converted. In other
words, unary numeric promotion converts operands
of byte, short, char to int by applying an implicit
widening conversion, but the operands of other
numeric types are not affected.
byte b=3
b=(byte) –b // numeric promotion of byte to int
before unary operator is applied
42. Binary Arithmetic Operators-
* Multiplication / Division % Modulus
+ addition - Subtraction
Numeric promotions- When binary operations are applied to
numeric arguments (integer and floating-point), numeric
promotion is performed before the operation takes place.
The binary addition operator ‘+’ performs two tasks:
One is to add two numbers
Second is to concatenate two String objects in
Java
43. Binary Arithmetic Operators-
* Multiplication / Division % Modulus
+ addition - Subtraction
Numeric promotions- When binary operations are applied to
numeric arguments (integer and floating-point), numeric
promotion is performed before the operation takes place.
The numeric promotion consists of converting the values of
the operands to a common type.The rules are:
One operand double , other is converted to double.
Otherwise, if one is float, then other is converted to
float.
Otherwise if one is long, other is converted to long
Otherwise both the operands are converted to int
Associativity of binary operators is from left to right
44. Comparison operators- to compare primitive values or object
references.
These operators are organized into three groups:
Relational operators----defined only for numeric values
Equality operators
instanceof operator------defined only for object references
Relational operators- Four relational operators are:
<
>
<=
>=
Results in a boolean value true or false if the operands on both sides show the
same relation as the operator or otherwise.
45. Equality operators
==
!=
When object references are compared, they are compared for same
object instance and not whether the objects have the same value.
equals method- This method is defined in Object class as a means to
compare the values of two objects.All the subclasses of Object class like
String class inherit this method and use it to compare the object values
rather than their instance equality.
46. instanceof operator- This is a binary operator that is used to determine whether an
object reference (the left operand) is an instance of the class, interface or array type specified
by the right operand. It cannot be used with primitive values( compilation error).
Logical Operators- Java supports two groups of logical operators, the
boolean operator !(not), & (and), | (or) and ^ (Exclusive-or) and the logical
short circuit operators &&( short-circuit and) and || (short-circuit or).All of
these operators are restricted to boolean operands.
Assignment Operators-
=
+=
-=
/=
*=
%=
&=
|=
^=
<<=
>>=
>>>=
47. Bitwise Operators- The bitwise operators are:
~(inversion)---------------unary operator. Inverses the
bits that make up the integer value
& (and)
| (or)
^ (exclusive-or)
Shift Operators-The shift operator <<(left shift),
>> (right shift) and >>> (unsigned right shift) also
work on the bit level.
Binary operators
48. Bitwise Operators- The bitwise operators are:
~(inversion)---------------unary operator. Inverses the
bits that make up the integer value
& (and)
| (or)
^ (exclusive-or)
&----returns a 1 bit if the corresponding bits of its
operands are both 1. It returns a 0 otherwise
|---returns a 1 bit if one of the corresponding bits of
its operands is 1 or if both of the corresponding
bits of its operands is 1. it returns a 0 otherwise
^-------returns a 0 bit if corresponding bits of it
operands are both 0 or both 1. It returns a 1
otherwise.
Binary operators
49. Shift Operators- The shift operator <<(left shift), >> (right
shift) and >>> (unsigned right shift) also work on the bit
level.
The << operator causes the bits of the left operand to be
shifted to the left based on the value of the right operand.
The new bits that are used to fill in the shifted right bits have
the value 0.
Each left shift corresponds to multiplication of the value by 2.
thus if shift is to be done by n, the value will be multiplied by
2n
50. class ByteShift {
public static void main(String args[]) {
byte a = 64, b;
int i;
i = a<< 2; //due to numeric promotion, we are assigning to int
variable
b = (byte) (a << 2);
System.out.println("Original value of a: " + a);
System.out.println("i and b: " + i + " " + b);
51. Right Shift Operator- The >> operator causes the
bits of the left operand to be shifted to the right
based on the value of the right operand. The new
bits that are used to fill in the shifted left bits have
the value of the leftmost bit (before the shift
operation).The syntax for giving this shift is:
value>>num
This is called the sign shift as it preserves the
sign (positive or negative) of the operand.
When a negative value is shifted right, ones are
filled in from the left.
Each right shift corresponds to division of the
value being shifted by 2
52. • Shifting the operand one bit to right is same as dividing it
by 2 and ignoring the remainder.
64 >> 1 gives 32 which is equal to 64 / 21
64 >> 2 gives 16 which is equal to 64 / 22
53. The >>> operator is identical to the >>
operator except that the bits that fill in the
shifted left bits have the value 0.This is said to
be unsigned shift as it does not preserve the
sign of the operand.
54. • One’s Complement Operator
– it can be effectively used is in development of a file encryption utility.
• Bitwise AND Operator
– Probably, the best use of the AND operator is to check whether a particular bit of an operand is
ON or OFF. This facility of checking the bit value as on or off is most useful in finding the type of a
file
– The second, and equally important use of the AND operator is in changing the status of the bit, or
more precisely to switch OFF a particular bit.
• Bitwise OR Operator
– Bitwise OR operator is usually used to put ON a particular bit in a number.
• Bitwise XOR Operator
– XOR operator is used to toggle a bit ON or OFF. A number XORed with another number twice
gives the original number.
55. • Logical Operators- Java supports two groups of
logical operators, the boolean operator !(not), &
(and), | (or) and ^ (Exclusive-or) and the logical
short circuit operators &&( short-circuit and) and ||
(short-circuit or). All of these operators are
restricted to boolean operands.
• The ! Operator performs the logical negation. It
changes true value to false and false value to true.
• &,| and ^ operate in the same manner as the
bitwise operators do when applied to each bit.
56. The ternary operator-The ternary operator ?:, also referred to as the
conditional operator has three operands and takes the following forms:
operand1 ? operand2 : operand3