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 created by James Gosling. It was originally called Oak but was later renamed to Java. The document discusses the different editions of Java including J2SE, J2EE, and J2ME. It also covers key Java technologies like applets, servlets, JSP, and Swing. The document provides an overview of Java features such as being platform independent, portable, multi-threaded, and having a Java Virtual Machine. It also discusses concepts like inheritance, interfaces, packages, exceptions, and input/output in Java.
The Spring Framework has always embraced testing as a first class citizen. Spring-based components should be modular, easy to wire together via dependency injection, and therefore easy to test. In fact, when well designed following a POJO programming model, a component in a Spring application can be unit tested without using Spring at all. And when you take the step toward developing integration tests, Spring's testing support is there to make your job easy.
Join Spring Test component lead Sam Brannen in this talk to learn about the basics for Spring's unit and integration testing support. This talk will provide attendees an overview of the following topics: unit testing without Spring, integration testing with Spring, loading application contexts (with and without context hierarchies), injecting dependencies into tests, transaction management for tests, SQL script execution, testing Spring MVC and REST web applications, and more.
This document outlines an introduction to API testing using Postman. It discusses:
1. What API testing is and different types like unit, end-to-end, and contract testing
2. How to send requests and inspect responses in Postman
3. Writing custom tests using snippets and variables to extract data between requests
4. Saving and running tests as collections
5. Additional resources like the Postman community forum and examples for writing tests
Spring Boot es un módulo de la plataforma Spring que tiene como objetivo simplificar la creación de aplicaciones y servicios listos para ejecutarse. Ofrece funcionalidad preconfigurada según la naturaleza del proyecto y características comunes como servidores embebidos y seguridad. Permite configurar automáticamente Spring y ejecutar aplicaciones de forma sencilla mediante el uso de starters y la clase SpringApplication.
Frameworks are large prewritten code to which you add your own code to solve a problem in a specific domain.
You make use of a framework by calling its methods,inheritance,and supplying “call-backs” listeners.
Spring is the most popular application development framework for enterprise Java™.
Millions of developers use Spring to create high performing, easily testable, reusable code without any lock-in.
The document provides an overview of the Java programming language. It discusses that Java was developed in the early 1990s by Sun Microsystems. It then summarizes some of Java's main features, including that it is a simple, object-oriented, robust, distributed, platform independent, secured, architecture-neutral, portable, high-performance, multi-threaded, and dynamic language. It also briefly discusses the Java Virtual Machine, Java Runtime Environment, Java Development Kit, Java bytecode, and the main method.
Postman is an API development platform that allows users to design, test, and monitor APIs. It provides a simple interface for creating API requests and testing suites. Key features include importing and exporting API collections, setting authentication parameters, and tracking HTTP response codes. The document demonstrates how to use Postman's interface to send sample GET, POST, PUT, and DELETE requests and view responses. It also lists common response codes like 200, 401, 403, and 500 and explains when each would occur.
This document discusses linking in the MS-DOS operating system. It describes how linking involves combining various pieces of code and data into a single file that can be loaded into memory and executed. The document outlines the role of linkers in automatically performing linking. It also provides details on the object module format and record types in MS-DOS, and describes how a linker would be designed for MS-DOS, including its invocation command format, linking and relocation processes, and use of data structures.
The document discusses the principles of clean code as outlined in the book "Clean Code" by Robert C. Martin. It covers topics like meaningful names, comments, functions, objects and data structures, error handling, and unit tests. The goal of clean code is to produce readable, maintainable code through practices like breaking code into small, single-purpose functions and hiding implementation details in objects.
Postman is an API development tool that allows users to design, manage, run, test, document, and share APIs. It provides features like request building, documentation, environments, test automation, and collaboration. Alternatives include Paw, Insomnia, command line tools like cURL, and services from Apigee and Apiary. The document recommends using any tool that helps share APIs, especially for complex projects and team collaboration.
This document provides an overview of threads in Java, including:
- Threads allow for multitasking by executing multiple processes simultaneously. They are lightweight processes that exist within a process and share system resources.
- Threads can be created by extending the Thread class or implementing the Runnable interface. The run() method defines the code executed by the thread.
- Threads transition between states like new, runnable, running, blocked, and dead during their lifecycle. Methods like start(), sleep(), join(), etc. impact the thread states.
- Synchronization is used to control access to shared resources when multiple threads access methods and data outside their run() methods. This prevents issues like inconsistent data.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Introduction To Python' will help you establish a strong hold on all the fundamentals in the Python programming language. Below are the topics covered in this PPT:
Introduction To Python
Keywords And Identifiers
Variables And Data Types
Operators
Loops In Python
Functions
Classes And Objects
OOPS Concepts
File Handling
YouTube Video: https://youtu.be/uYjRzbP5aZs
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Introduction to java beans, java beans, Core java, j2se, getting started with java beans programming, java to standard edition, beans in java, beans programming in java
Variables, Data Types and Activities in UiPath | Basics of UiPath | UiPath Tu...Edureka!
** RPA Training: https://www.edureka.co/robotic-process-automation-training **
This Edureka PPT on "Variables, Data Types, and Activities in UiPath" will cover the fundamental concepts of UiPath.
Below are the topics covered in the PPT :
What is RPA?
What is UiPath?
UiPath Overview:
Projects in UiPath
UiPath Dashboard
Flowcharts and Sequences
Variables
Activities
Message Box
Assign
Write CSV
If
For Each
While
Do While
Switch
RPA Playlist: https://bit.ly/2B53HLe
RPA Blog Series: https://bit.ly/2Ay1bzG
Instagram: https://www.instagram.com/edureka_lea...
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Postman is a collaboration platform that simplifies each step of building an API and streamlining collaboration to create better APIs faster. It is a popular API client that allows users to send HTTP/HTTPS requests to services and view responses. Postman offers features like a community forum, integration with CI/CD tools, extensibility, the ability to make any type of API call, and is freely available and easy to use.
Pokemon battle simulator (Java Program written on Blue J Editor)Mahir Bathija
This document contains code for a Pokemon battle game. It defines classes for different Pokemon like Charizard, Blastoise, and Venasaur. Each Pokemon has stats like HP, attack, defense and moves. The main method runs a battle between two Pokemon by having the user select a Pokemon for each player. It then simulates the battle by having players choose moves and calculating damage based on type advantages/disadvantages until one Pokemon loses.
El documento proporciona información sobre el centro odontológico Isora en Valencia, Venezuela. El centro cuenta con una silla odontológica y un odontólogo general. Ofrece servicios de radiología y procesamiento de tarjetas de crédito/débito. El odontólogo Yolanda de Andrade atiende de lunes a viernes de 7 am a 12 pm y de 2 pm a 6 pm.
The document provides guidance on creating an effective investor presentation, including formatting recommendations and a suggested slide order and content. Key recommendations include keeping the presentation concise at 20-30 minutes, using simple graphics and fonts, focusing each slide on 3-6 bullet points, and including sections that define the problem, solution, market opportunity, business model, management team, financial projections, funding request and timeline. The goal is to clearly present the business opportunity and build investor interest and confidence.
The document summarizes a training of trainers event and steering committee meeting that was held from March 4-6, 2015 in Deventer, Netherlands for the "IGMA II" project. The goal of the events was to prepare trainers on the methodological framework and 8 training modules developed by the project, in order to test them in upcoming pilot activities. The project coordinator expressed that passing on their knowledge to the trainers was fulfilling and that good results are anticipated from the pilots. The overall aim of the "IGMA II" project is to develop a professional standard for counselling low-skilled individuals into the labor market through adult education.
Gaopeng gets into top 10 by revenue; QQtuan becomes a sales platform. dataotuan
The Chinese Daily Deal Market in September
Gaopeng gets into top 10 by revenue; QQtuan becomes a sales platform.
An overview of the Chinese Daily Deal (Groupbuying Market)
Who are the main players, what is the trend of the market, how does the market develop in different regions, and what are latest highlights
Este documento presenta información sobre el pintor Pablo Picasso. Se proporcionan detalles biográficos como su lugar y fecha de nacimiento, su primer profesor de arte y los lugares donde vivió. También se mencionan los periodos artísticos más importantes de Picasso como el Período Azul, Rosa y Cubista, describiendo brevemente sus características. Finalmente, se pide al estudiante completar actividades relacionadas con estos periodos y descubrir una palabra secreta a través de un código numérico.
Recomendaciones para la gestión de una Fanpage: cómo crear presentaciones, cómo programar publicaciones, cómo crear anuncios, estadísticas de Facebook y cómo dar Me Gusta desde nuestro perfil persona.
El DDA es un almacén autorizado por la Agencia Tributaria española donde los importadores pueden almacenar mercancías sin liquidar el IVA inmediatamente. La mercancía se vincula al DDA y puede almacenarse indefinidamente o venderse a terceros sin pagar el IVA, lo que puede suponer un ahorro financiero. El importador decide si auto-liquida el IVA o transfiere la titularidad mediante factura de venta.
Este documento describe las etapas del desarrollo del lenguaje en los niños. Comienza con el balbuceo entre los 3-9 meses, seguido de la etapa pre-lingüística de 0-12 meses donde los niños comienzan a imitar sonidos. Luego viene la etapa lingüística de 1-6 años donde los niños empiezan a decir sus primeras palabras y desarrollan un propósito comunicativo con el lenguaje.
Bruna elid e beatriz messias pronto 26 abrilNute Jpa
A fotossíntese é o processo através do qual as plantas e outros organismos com clorofila convertem dióxido de carbono e água em glicose utilizando a energia da luz do sol. Sem a fotossíntese, nenhum ser vivo poderia sobreviver, portanto é essencial que protejamos o meio ambiente e a qualidade do ar no planeta.
This document summarizes a copyright infringement case involving the songs "He's So Fine" and "My Sweet Lord." It discusses how the U.S. Constitution gives Congress the power to grant copyright protections. The creator of an original work automatically receives copyright protections upon creation. The case of Bright Tunes Music Corp. v. Harrisongs Music, Ltd. found that while former Beatle George Harrison did not deliberately copy "He's So Fine" in creating "My Sweet Lord," he had subconsciously utilized elements of the earlier song. Harrison was found liable for plagiarism due to the strong melodic similarities between the two songs.
Eset españa informe cuatrimestral de seguridad (mayo agosto)Yolanda Ruiz Hervás
Este documento resume los principales incidentes de seguridad ocurridos entre mayo y agosto de 2012. Durante este periodo, varias grandes empresas como Facebook, Twitter, LinkedIn y Apple sufrieron filtraciones de datos o vulnerabilidades en sus sistemas que fueron explotadas por ciberdelincuentes. También hubo ataques dirigidos a sistemas críticos como los de transporte y hospitales, y se descubrieron vulnerabilidades en software ampliamente usado como MySQL, Flash Player y sistemas operativos. Los ciberdelincuentes aprove
Este documento presenta una guía práctica para exportar productos agrícolas a Corea del Sur, Japón y Singapur. Detalla los requisitos sanitarios y fitosanitarios para cada país, incluyendo las estructuras regulatorias, los pasos para exportar, las normas de etiquetado, envasado y almacenamiento, y los requisitos específicos para diferentes productos como frutas, carnes y pescados. El objetivo es proveer información a los exportadores latinoamericanos para facilitar el acceso a estos mercados asiátic
Here are the translations of the sentences into Arabic:
(1)
(2) The teacher teaches the students every day.
(3) I will return home tomorrow.
(4) He plays football in the evening.
(5) She thanks Allah for His blessings.
Ver el funcionamiento en el programa cosimir de un robot paletizador, y con lo aprendido en el curso desarrollar una programación similar para desarrollar los movimientos de paletizado
This document provides an overview of object-oriented programming concepts in Java including abstraction, encapsulation, inheritance, and polymorphism. It discusses key Java concepts like classes, objects, methods, and access specifiers. It also covers Java fundamentals like variables, data types, operators, control flow statements, comments, and arrays. Additionally, it describes the Java runtime environment, how to set up a Java development environment, compile and run a simple Java program. The document is intended as an introduction to object-oriented programming and the Java programming language.
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.
The document discusses the fundamentals of object-oriented programming and Java. It covers key concepts like abstraction, encapsulation, inheritance and polymorphism. It also describes the basic structure of a Java program, including classes, objects, methods and variables. It explains how to set up a Java development environment, compile and run a simple Java program.
Java is an object-oriented programming language originally developed by Sun Microsystems. There are four main types of Java applications: standalone, web, enterprise, and mobile. The key features of Java include being platform independent, secure, robust, and distributed. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM) on any device. The JVM performs tasks like loading code, memory management, and execution. There are various data types in Java including primitives like int and double, and reference types like classes. Variables are used to store and reference values in memory and can be local, instance, or class variables. Arrays provide a way to store multiple values of the same type.
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.
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.
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.
This document provides an overview of the Java programming language and environment. It discusses that Java is both a programming language and platform, and describes some of Java's key characteristics like being object-oriented, platform independent, secure, robust and high performance. It also outlines the different types of applications that can be created in Java, such as standalone, web, enterprise and mobile applications. The document concludes by explaining the basic steps to compile and run a simple Java program, and some modifications that can be made to the main method.
This document provides an introduction to programming in Java. It discusses key Java concepts like object-oriented programming, classes, objects, and encapsulation. It explains that Java code is compiled to bytecode that runs on a virtual machine, making Java portable across platforms. The document also gives an overview of Java features and components like the Java Development Kit tools, APIs, and libraries. It provides examples of simple Java programs and how they are compiled and executed.
This document provides an introduction and overview of the Java programming language. It discusses what Java is, the history and origins of Java, key features and buzzwords of Java such as being simple, object-oriented, platform independent, and secure. It also compares Java to C++ and describes the three main types of Java: Java 2 Standard Edition, Java 2 Enterprise Edition, and Java 2 Micro Edition.
Java is a general-purpose programming language that is both compiled and interpreted. It allows developers to "write once, run anywhere," meaning that Java code can run on any device that supports a Java Virtual Machine (JVM), without needing to be recompiled. The key features of Java include being simple, object-oriented, robust, secure, portable, and high-performance. Java code is first compiled into bytecode, which can then be executed by a JVM on various operating systems like Windows, Linux, and macOS.
This document provides an overview of Java including its history, versions, key features, and basic programming concepts. It describes how Java was originally called Oak and later renamed to Java in 1995. It also lists the main Java versions from 1995 to 2011. Additionally, it defines Java as a platform independent language and outlines some of its common uses. The document proceeds to explain Java's main features such as being simple, object-oriented, platform independent, secure, portable, dynamic, high performance, and multithreaded. It also includes examples of a simple Java program, variables, and packages.
The document provides an introduction to Java programming language. It discusses that Java was originally developed by James Gosling at Sun Microsystems in 1991 and was named Oak. It was later renamed to Java in 1995. The document also describes Java features such as it is a purely object-oriented language, platform independent, secure, robust, portable, and supports multithreading.
The document provides an overview of Java programming concepts across 4 chapters. Chapter 1 discusses object-oriented programming principles like abstraction, encapsulation, and polymorphism. It also provides a brief history of computing paradigms. Chapter 2 discusses the Java platform, including key benefits like platform independence and security. It also explains the Java compilation and execution process. Chapter 3 covers Java fundamentals like the basic "Hello World" program structure, naming conventions, and basic data types in Java.
This document provides an overview of object-oriented programming and the Java platform. It discusses the history of computing and the development of object-oriented programming. It then describes key concepts of object-oriented programming like classes, objects, encapsulation, inheritance and polymorphism. The document also gives an introduction to the Java programming language, its benefits like portability and its components like the Java Runtime Environment. It provides details on compiling and running a simple Java program and the different phases involved.
This document provides an overview of object-oriented programming and the Java platform. It discusses the history of computing and the development of object-oriented programming. It then covers key concepts of object-oriented programming like classes, objects, encapsulation, inheritance and polymorphism. The document also provides details about the Java programming language, its benefits like portability and its components like the Java Runtime Environment. It concludes with explaining the phases of creating and executing a Java program from writing code to running the compiled bytecode.
The document provides an overview of Java programming concepts across 4 chapters. Chapter 1 discusses object-oriented programming principles like abstraction, encapsulation, and polymorphism. It also provides a brief history of computing paradigms. Chapter 2 discusses the Java platform, including key benefits like platform independence and security. It explains the Java compilation and execution process. Chapter 3 covers basic Java concepts like data types, variables, and methods. It provides examples of "Hello World" programs.
The document provides an overview of Java programming concepts across 4 chapters. Chapter 1 discusses object-oriented programming principles like abstraction, encapsulation, and polymorphism. It also provides a brief history of computing paradigms. Chapter 2 discusses the Java platform, including key benefits like being platform independent and object-oriented. It explains the Java compilation and execution process. Chapter 3 covers basic Java concepts like the structure of a simple Java program, naming conventions, and primitive data types.
The document provides an overview of Java programming concepts across 4 chapters. Chapter 1 discusses object-oriented programming principles like abstraction, encapsulation, and polymorphism. It also provides a brief history of computing paradigms. Chapter 2 discusses the Java platform, including key benefits like platform independence and security. It explains the Java compilation and execution process. Chapter 3 covers basic Java concepts like data types, variables, and methods.
Web applications vulnerabilities and threatsPrakash Poudel
This document discusses vulnerabilities and threats related to web applications. It begins with an introduction on web application security and the importance of securing data transmitted online. It then reviews literature on cyber security practices and common cyber attacks. The document outlines various encryption techniques used for web applications, including Triple DES, RSA, and AES. It identifies issues like poor configuration, low security budgets, and lack of alerts that can compromise web server hardware security. The document emphasizes the need to protect internal networks, recover from attacks, and use security measures like firewalls, encryption, and regular software updates and backups to secure web applications.
Earliest Due Date Algorithm for Task scheduling for cloud computingPrakash Poudel
The document discusses the Earliest Due Date algorithm for task scheduling in cloud computing. It begins with an introduction to cloud computing and describes how it provides computing resources over the internet. It then provides an overview of task scheduling algorithms, including their purpose of assigning tasks to resources to optimize performance. The document focuses on the Earliest Due Date algorithm, which executes tasks based on the earliest deadline first. It provides an example of how EDD would schedule a set of tasks and discusses how EDD is optimal for real-time systems as it attempts to minimize maximum lateness. The document concludes by noting some advantages of EDD while also acknowledging it does not consider processing time.
The document discusses principles of software management and development practices. It covers:
1. Establishing iterative lifecycle processes that identify risks early through multiple iterations of problem understanding, solution design, and planning.
2. Transitioning design methods to emphasize component-based development using pre-existing code to reduce custom development.
3. Enhancing change freedom through automated tools that support round-trip engineering and synchronization across different formats and stages of the iterative development process.
This document summarizes research on lock-based concurrency control for distributed database management systems (DDBMS). It defines lock-based algorithms and protocols like two-phase locking (2PL) that ensure serializable access to shared data. The 2PL protocol is discussed in centralized, primary copy, and distributed implementations for DDBMS. The communication structure of distributed 2PL is also outlined, with lock managers coordinating access across database sites. In conclusion, lock-based concurrency control using 2PL is commonly used to achieve consistency while allowing maximum concurrency in transaction processing.
Cocomo ( cot constrictive model) and capability maturity modelPrakash Poudel
The document provides details about the COCOMO cost estimation model and its various stages and formulas. It discusses the three classes of software projects - Organic, Semi-Detached and Embedded - that COCOMO can be applied to. The stages of COCOMO are described as Basic, Intermediate and Detailed. Formulas for effort, time and people estimation are provided for each stage. An example case study is presented to demonstrate the use of COCOMO.
The document is a collection of scanned pages from a passport application. It contains personal information such as the applicant's name, date of birth, place of birth, citizenship, gender, marital status, height, eye color, identification numbers, current address, signature, and photograph. The majority of the pages contain the applicant's biographical details and signatures verifying the information provided.
The maximum power transfer theorem states that maximum power is transferred from a source to a load when their resistances are equal. It results in maximum power transfer, not maximum efficiency. The theorem can be extended to AC circuits using impedance.
Ohm's law describes the direct proportional relationship between current and voltage in a circuit, where resistance is the constant of proportionality. R=V/I.
A Zener diode allows current to flow in the reverse direction above a certain breakdown voltage, known as the Zener or knee voltage. It is used to generate reference voltages or stabilize voltages in low current applications.
This document provides an overview of the history and development of the Linux operating system. It discusses how Linux originated from earlier operating systems like Unix and was completed using software from the GNU project. Key advantages of Linux mentioned include low cost, stability, performance, flexibility and security. The document also describes the file hierarchy and culture of free software in Linux. It provides examples of commands used in Linux and explains the use of sudo for privilege escalation.
The document is a rental agreement between John Doe and ABC Properties for the lease of an apartment located at 123 Main St for a period of 12 months beginning January 1st, 2023. The agreement outlines the monthly rent amount, late fees, utilities responsibilities, repairs, notices for entry and termination of the lease.
Root is a privileged user in Linux that has full administrative access over the system. Kudzu is a hardware detection tool that runs at boot to detect and configure new or removed hardware, such as networking devices, sound cards, mice, and CD-ROMs. System monitoring tools like top, vmstat, iostat, and df can be used to check CPU and memory usage, disk space, and network traffic.
The document describes a simulation of a telephone system to track processed, completed, blocked and busy calls. It shows the system state at various time steps as calls arrive and are connected or finished. When lines are all in use, arriving calls are delayed rather than lost. The simulation runs by scanning for the next event, selecting the activity that causes it, updating records to reflect the event's effects, and gathering statistics.
General Online Health Information System Proposed ApplicationPrakash Poudel
This document summarizes a health information system presented by Prakash Poudel. It introduces the system as a web-based application that aims to provide easier access to healthcare information and preventative measures for visitors. The objectives of the system are to facilitate the movement of healthcare information to the public, provide information on diseases and preventative measures, find possible diseases based on symptoms, provide health tips, suggest doctors and hospitals, provide emergency information, notify users about spreading diseases, and give updates on the Nepal's health situation. Screenshots of the website demonstrate modules for searching doctors and viewing doctor introductions.
Nepal Doorsanchar Company Limited Internship Experience Prakash Poudel
Prakash Poudel presented on his internship at Nepal Doorsanchar Company Ltd. The objectives of the internship were to enhance skills in communication, management, and gaining practical experience. Nepal Doorsanchar Company Ltd was established in 1970 and was formerly known as Nepal Telecom. As part of the internship, Prakash helped customers with GPRS settings and learned about GSM, IP CDMA, and Nepal Telecom's transmission systems. He also developed a web-based application for online registration management. In conclusion, Prakash felt he gained valuable experience in management, web programming, and telecommunications systems through the internship.
This document provides an overview of SQL (Structured Query Language) including its main features and components. It describes that SQL has both a Data Manipulation Language (DML) used for queries and updates, and a Data Definition Language (DDL) used for defining and modifying database structures. It also explains several important SQL constraints - NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK and DEFAULT - that can be applied when creating or altering tables to restrict the type of data that can be stored. Examples are given of the syntax for applying these constraints in CREATE TABLE and ALTER TABLE statements.
Software engineering deals with building large, complex software systems through a team-based approach. It aims to clearly define problems, use standard tools and techniques, and approach development like engineering disciplines such as building construction. Key aspects include requirements analysis, system design, coding, testing, and maintenance. Tools and environments support software engineering activities and have evolved from basic editors and compilers to integrated development environments. Specifications are precise statements of what a system must do and are used to define requirements, design interfaces, and module behaviors.
Here are the key points of comparison and contrast between Macintosh and Windows platforms for multimedia:
Similarities:
- Both support multimedia capabilities like audio, video, graphics etc.
Differences:
- Macintosh is based on Unix operating system while Windows is based on DOS.
- Macintosh is used only on Apple hardware while Windows can be used universally on different hardware.
- Macintosh has more in-built features for multimedia like better graphics quality, audio/video editing capabilities etc. Windows focuses more on general office functions.
- Macintosh is better suited for graphics/multimedia work due to its heritage and optimization for those tasks. Windows graphics capabilities have improved over time but are still not at the same
This document discusses basic file permissions in Linux/Unix. It covers the different file attributes seen in the ls -l command output including permissions, owner, group, size and date. It describes the rwx permissions for owner, group and others. It also explains how to modify permissions using chmod with absolute and symbolic modes, and how to change file ownership with chown.
This document provides an overview of organizations and management. It defines an organization as a social unit of people that is structured and managed to meet a need or pursue collective goals. There are three levels of management in organizations: top level management which determines objectives and policies, middle level management which implements plans and coordinates activities, and low level management which directs workers and communicates between workers and higher levels of management. The document also summarizes several management theories including scientific management, behavioral management, contingency theory, and systems theory.
This document provides an overview of organizational management concepts including:
1. It defines an organization and management, outlining their key purposes and functions.
2. It describes the three levels of management in organizational hierarchies - top, middle, and low level management - and their distinct roles and responsibilities.
3. It introduces several management theories, most notably scientific management theory which aims to increase productivity through efficiency, and behavioral management theory which emphasizes understanding human behavior and motivation in the workplace.
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.
In May 2024, globally renowned natural diamond crafting company Shree Ramkrishna Exports Pvt. Ltd. (SRK) became the first company in the world to achieve GNFZ’s final net zero certification for existing buildings, for its two two flagship crafting facilities SRK House and SRK Empire. Initially targeting 2030 to reach net zero, SRK joined forces with the Global Network for Zero (GNFZ) to accelerate its target to 2024 — a trailblazing achievement toward emissions elimination.
Response & Safe AI at Summer School of AI at IIITHIIIT Hyderabad
Talk covering Guardrails , Jailbreak, What is an alignment problem? RLHF, EU AI Act, Machine & Graph unlearning, Bias, Inconsistency, Probing, Interpretability, Bias
OCS Training Institute is pleased to co-operate with
a Global provider of Rig Inspection/Audits,
Commission-ing, Compliance & Acceptance as well as
& Engineering for Offshore Drilling Rigs, to deliver
Drilling Rig Inspec-tion Workshops (RIW) which
teaches the inspection & maintenance procedures
required to ensure equipment integrity. Candidates
learn to implement the relevant standards &
understand industry requirements so that they can
verify the condition of a rig’s equipment & improve
safety, thus reducing the number of accidents and
protecting the asset.
Profiling of Cafe Business in Talavera, Nueva Ecija: A Basis for Development ...IJAEMSJORNAL
This study aimed to profile the coffee shops in Talavera, Nueva Ecija, to develop a standardized checklist for aspiring entrepreneurs. The researchers surveyed 10 coffee shop owners in the municipality of Talavera. Through surveys, the researchers delved into the Owner's Demographic, Business details, Financial Requirements, and other requirements needed to consider starting up a coffee shop. Furthermore, through accurate analysis, the data obtained from the coffee shop owners are arranged to derive key insights. By analyzing this data, the study identifies best practices associated with start-up coffee shops’ profitability in Talavera. These findings were translated into a standardized checklist outlining essential procedures including the lists of equipment needed, financial requirements, and the Traditional and Social Media Marketing techniques. This standardized checklist served as a valuable tool for aspiring and existing coffee shop owners in Talavera, streamlining operations, ensuring consistency, and contributing to business success.
A vernier caliper is a precision instrument used to measure dimensions with high accuracy. It can measure internal and external dimensions, as well as depths.
Here is a detailed description of its parts and how to use it.
Software Engineering and Project Management - Introduction to Project ManagementPrakhyath Rai
Introduction to Project Management: Introduction, Project and Importance of Project Management, Contract Management, Activities Covered by Software Project Management, Plans, Methods and Methodologies, some ways of categorizing Software Projects, Stakeholders, Setting Objectives, Business Case, Project Success and Failure, Management and Management Control, Project Management life cycle, Traditional versus Modern Project Management Practices.
2. What is Java?
• Java is a purely an Object Oriented programming language
• Java began life as the programming language called ‘OAK’
• OAK was developed in 1991 by the programmers of Sun
Microsystem, Now owned by Oracle Inc.
• Oak developer team wanted a new way of computing, so
they decided to make programming language to run in
different kinds of computers, consumer devices and OAK
got the new name called ‘Java’
• The goal of java is “Write Once; run anywhere”. It is
platform independent language
• Java is inspired by C, C++ syntax.
3. Applications of Java
• Embedded Systems such as consumer devices
• Personal Computers
• Distributed Systems
• World Wide Web(Eg. Applet, JSP etc)
• Smart Phones, Mobiles
4. Java Editions
• Java 2 Standard Edition(J2SE)- Used for
standard desktop application development
• Java 2 Enterprise Edition(J2EE)- Used for
developing Web or Distributed applications
• Java 2 Micro Edition(J2ME) – Used for
application development for most of the
featured mobiles phones i.e Nokia Series 40,
eg. Nokia 2700.
5. JAVA ENVIRONMENT
• Java is both compiled and interpreted
C Code
Machine Code(CPU Specific)
Compiled
JAVA Code
Bytecode(CPU independent)
Executed By CPU,
Executed By Java Virtual
Machine,
Compiled
Interpreted
6. Java Virtual Machine
• JVM is a software program which can execute
the byte codes. It runs on existing OS.It is a
type of virtual machine.
7. Byte code
• It is fully optimized set of instructions designed to
be executed by JVM(Java Virtual Machine)
• Translating Java Program into byte code helps run
program in wide variety of environment s
because only task is to make JVM for that
particular platform
• Byte code is interpreted by JVM.
• It is secure because execution of Java program is
always under control of JVM
• In computer, bytecode is stored in a Class file. Eg.
Test.class
8. Features of Java
• Simple and powerful:
– It is simple to understand by professional programmers
– Every one with the knowledge of programming and Object oriented
programming concept feels it is simple
• Secure
– Java programs are confined within Java execution environment or
JVM, Java programs and Applets(Web GUI objects) can be downloaded
without fear of virus
• Portable
– Java uses byte code concept which is not executed by CPU but Java
virtual machine so we can use single code for multiple platforms
• Object Oriented
– Java uses realistic approach of OOP. Every thing other than simple data
types such as int, float etc are used as objects.
9. Features of Java
• Robust:
– Java programs are reliable from memory management view
– Java forces programmers to find mistakes in early stage of
development
– Java has automatic Garbage Collection. So users need not to be worry
about memory management problems which is big disadvantage of C
where users need to allocate and de-allocate memory manually.
– Garbage Collection is the feature of JVM where memory is allocated
for object when uses and if objects are not used, they are cleared
from memory
• Multithreaded
– Thread is a particular part of a program. Java enables performing
multiple tasks within a program simultaneously.
– E.g. Antivirus can do two repetitive tasks together. We can update
antivirus while virus scan is running
• Architecture-Neutral
– Once java program is written, it can be executed in any environment.
10. Features of Java
• Interpreted and High Performance:
– Java programs run comparatively faster than other
interpreted language like BASIC
– It is designed to run in low power CPU. So Java is the first
choice for Mobile Programming.
• Distributed
– Java programs can run over TCP/IP protocols. We can
design programs which can call the methods of Remote
program. For this, java provides RMI(Remote Method
Invocation)
• Dynamic
– Java allows accessing objects dynamically in run time.
Small fragment of byte code can be updated dynamically in
the run-time.
11. Object Oriented Programming Concept
•Every Object has attributes(state) and
behavior, for Tata-Nano Object
Particular TATA-Nano is a
real world object
States or attributes Behaviour
Wheels Gear up
Model Run
Horse Power Gear down
Seats Brake
• For every Computer Object,
attributes(state) are called data or
behavior is called Method
Data(Variables) Methods(Functions)
totWheels gearUp()
modelNo run()
horsePower gearDown()
totalSeats brakeDown()
In a Racing Game(Ferrari)
12. Computer OBJECT
Definition
An Object is a software
bundle of related
state(fields or data) and
behavior(Methods or
functions). Software
objects are often used to
model real world objects
that we find in everyday
life. E.g. Button, Car, Cat
etc
Task: Make a list of objects you see in your everyday life and make a list of their
states and behavior.
13. What is CLASS
CAR ANIMAL
Tata-Nano Ferrari Cow Tiger
Tata-nano and Ferrari fall under CAR class, Cow and Tiger fall
under Animal class
In object-oriented terms, we say that our bike(eg. Pulsar) is an instance of the class of
objects known as motorbike. A class is the blueprint(outline) from which individual objects
are created.
14. What is Abstraction
Abstraction is one of the fundamental principle of OOP
which helps to reduce the complexity. It helps to separate
methods and data that change frequently. In makes
system flexible.
You got a new mobile. You start using it without knowing the complexity of it’s internal
structure. While using Mobile, we do not need to know about its internal parts. The
frequently changeable features like Battery, cover, sim card are accessible. Other parts are
hidden. This reduces complexity.
15. Encapsulation
Encapsulation is the mechanism that binds code and data
together and keeps both safe from outside misuse. It is the
protective wall to prevent code inside class being
randomly accessed.
* Note : abstraction and encapsulation seem to be similar but abstraction uses interface
and encapsulation uses access modifiers(private, public,protected) to hide data. These
will be discussed later
16. What is Inheritance
Vehicle
Bike
CBZ Discover
Car
Santro
Maruti-
SX4
Object
Controls
Button Textbox
Forms
MDI
parent
Dialog
•Different kinds of objects often have a certain amount in common with each other
•Bike, Car class inherit from Vehicle class. CBZ, Discover inherit from Bike Class
•The possible object for here becomes particular CBZ bike with particular engine number.
•Here Vehicle is Super Class for derived class Bike, and Bike is called Base or derived class
•In OOP, Inheritance is the way to reuse the code of existing class. Here one object acquires
properties of another object.
Objects: Button save , exit;
17. Polymorphism
•Polymorphism(“ Many Forms”) is the process of making methods in OOP to perform
multiple tasks. eg;: we can make a function called ADD() to calculate the sum of two
numbers or two Strings with a single name. Making such methods is also called
Overloading
18. Starting Java
To work with java, We need following:
•Latest Java Development Kit(www.oracle.com) . It also
JRE(java runtime environment)
•Any text editors like Notepad, Notepad++
•IDE(Integrated Development Environment) like
Netbean or Eclipse for easier development
19. Installing and configuring
•Install JDK
•Define following environment
variables
•Goto run
•Type sysdm.cpl
•Goto Advanced tab
•Click environment variable
button
20. Installing and configuring
•Path: ;C:Program Files (x86)Javajdk1.6.0bin
•CLASSPATH: D:Java
•JAVA_HOME: C:Program Files (x86)Javajdk1.6.0bin
Path: defining path helps to access java commands directly from Command
Prompt(cmd)
CLASSPATH: the location where compiled classes are loaded, java searches classes
here
JAVA_HOME:It is the path of directory where Java.exe can be found
21. First Java Program
//class name is First so save file as First.java
class First{
public static void main(String args[]) {
System.out.println(“First Program”);
}
}
•Save file as First.java
• compile:
•D:/java>javac First.java
•Run
•D:/java>java First
First Program
22. First Java Program
class First {
It defines the name of the class
// this is single line comment
/* thi is multi line
Comment
*/
public static void main(String args[]){
•public : It is public access modifier which can be called from outside.
•Static : this keyword tells that to call main() function, instance of First is not required.
Every static data members can be directly accessed without creating object of class.
•void refers an empty data type so this function does not return any value
•main()- the function that is called automatically when application is launched
•args[]-these are number of values which can be passed into program.
•For example:
•C:/>format c: enter
•Here c: is an argument
Enter
23. Coding Conventions
•make all constants are written in UPPERCASE.
Eg.MAX_HOURS,FILL_COLOR etc
•Eg: static final MAX_SPEED=100;
• write all statements and other keywords in lowercase eg
import,if,for,while
•Name of the class is CamelCased. Eg MyFirstClass. If single word
is used then : class First { }.
•Objects, variables and function names are written in mixedCase.
For example:
•Button butSave=new Button();
•public int findSum() {
•Int firstNum,secondNum etc
•Always initialize values of the variables before use.
24. Second Java Program
//class name is First so save file as SecondJava.java
class SecondJava{
public static void main(String args[]) {
int age=10;
System.out.println(“I am ”+age+” years old.
After 10 years, I will be “+(age+10)+” years old”);
}
}
•Save file as SecondJava.java
• compile:
•D:/java>javac SecondJava.java
•Run
•D:/java>java SecondJava
I am 10 years old. After 10 years, I will be 20 years old
25. Data Types
Java is called Strongly Typed or strict typed language because
every identifier(variable or constant) has data type and these all
needs to be strictly defined first with type and used later. It is
similar to C, C++. But java is more strict. You can not assign
floating point value to integer but in java you can not. Java
compiler performs strong-type checking during compilation.
int a=2.2; is wrong in java but correct in c,c++
26. Simple Data Types
These are also called primitive data type.
Integers: integer data type holds integer value which is signed. Java does
not support positive only values like C.
byte 1byte -128 to 127
short 2 bytes -32768 to 32767
int 4 bytes -(231 ) to (231)-1
long 8 bytes(64bit) -(263) to (263)-1
Floating-Point Types hold real numbers and used with fractional values:
float 32bits 1.4e-45 to 3.4e038
double 64bits 4.9e-324 to 1.8e308
Characters: Java char data type uses 16 bit space where c, c++ char takes 8
bit. The reason is java also supports Unicode representation. Characters are
treated numeric values as we can do calculations also, In java char is used
27. Simple Data Types
Boolean: Boolean holds logical values such as true or false. It
occupies 1 bit storage
class CharTest{
public static void main(String args[]) {
char a='A';
char b=66;
System.out.printf("a is %c and b is %c ",a,b);
++b;
System.out.println(" and after increment, b is "+b);
}
}
Output is : a is A and b is B and after increment, b is C
28. Wrapper Class(Reference Types)
There are some situations where data types are required to
be true objects.eg. If we want to derive data type. For this
purpose java provides wrapper classes where primitive data
types are written as object, here first letter is capitalized.
Eg. Integer, String, Character etc.
public class First {
public static void main(String args[]) {
int a=10;
Integer obj=new Integer(15);
System.out.println("premitive is "+a+" Wrapper is
"+obj.intValue());
}
}
29. Literals
Literals are the values assigned to any variable.
•Eg. Int a=5; here 5 is integer literal.
•String literals are double quoted
String name=“Suman”
•Boolean literal uses true or false keyword
boolean a=true;
•A character is single quoted
char choice=‘Y’;
30. Escape Sequence
Escape characters are written with . These are used to
represent control characters
Escape Description
n New line
t Tab
’ Single quote
” Double quote
f Form feed
b Backspace
ddd Octal
uxxx unicode
31. Example
public class Escape{
public static void main(String args[]) {
String quote="Programming is Fun";
System.out.println("Many people say ""+quote+""");
}
}
Output is : Many people say “Programming is Fun”
32. Variables
Variable is an identifier which holds certain value that can be
changed. A variable has type, scope and lifetime. Variable
name can start with $ or an alphabet and can be followed by
underscore. It can not contain whitespace.
•Declaring variable
<type> <var_name>=[<value>]
Eg.
Int a=5; //declared and initialized
Int x,y,z; //declared only
Int m,n=6; //mixed declaration and initialization
Int t; // declared and later initialized
t=9;
33. Dynamic initialization
What is dynamic initialization? Give an example. (QB)
Dynamic initialization is the process of assigning value to
a variable dynamically during runtime. We can not perform
dynamic initialization to the variables declared with final
keyword.
public class Init{
public static void main(String args[]) {
int a=10; // this is static initialization
int b=a*10; //this is dynamic initialization
System.out.println(“a is “+a+” and b is “+b);
}
}
Output is : a is 10 and b is 100
34. Variable scope and lifetime
Scope refers variable accessibility and lifetime refers to its’
existence. Curly brace defines the scope.
{
int a;
}
// a can not be accessed from here
35. Variable scope and lifetime
Nested scope.
class test{
int a;
class inner{
int a;
// wrong duplicate definition. Variable can be accessed
from inner scope.
}
}
Where program exit from scope, variable is destroyed
36. Type conversion and Casting
Type casting is the process of converting values from one type to
another type.
•Automatic conversion(implicit)
•Automatic conversion takes place if two types are
compatible(ie. Int,float,byte,short,long etc)
•If destination is larger than source.
If above conditions are met, Widening Conversion takes
place
•Casting incompatible types(explicit)
Casting between incompatible types, we need to use cast
expression,
(target-type) value;
Eg. Convert int to byte
37. Automatic type promotion
Consider a situation
byte a=30;
byte b=20;
int c=b*c;
While converting using expression b*c may become more than
255. so while using short and byte to any expression, these are
automatically promoted to int.
Another example
byte a=20;
b=a*2; //wrong can not assign int to byte
// this is correct way because int is converted to byte
b=(byte)(a*2);
38. Type conversion and Casting
int a;
a=258;
byte b;
b=(byte) a; // a is integer and casted to byte
Note: here b is byte which holds smaller values than int. byte
can hold 8 bits. So maximum values are 28=256.
When we assign 258 to byte, Narrowing Conversion takes
place. If target smaller than only remainder will be assigned.
So value of b becomes 258 % 256=2
39. Example
public class cast {
public static void main(String args[]) {
int a; // this is static initialization
byte b;
a=258;
b=(byte) a;
System.out.println(b); //2 will be printed
float f=15.55f;
int c=(int) f;
System.out.println(c); // 15 will be printed
double e=1554554.4582;
float g=(float) e;
System.out.println(g); // 1554554.5 will be printed because it can take upto 8
digits
}
}
40. Type promotion rules
When an expression contains many types. Other types are
promoted to bigger one.
•In an expression byte and short are automatically promoted
to int
•If one operand is long, entire expression is converted to long
•If any operand is float, entire expression is converted to
float
•If any operand is double, entire expression is converted to
double
41. Example of promotion
class AutoPromote{
public static void main(String args[]) {
byte a=50;
short s=1000;
int i=10550;
float f=10.5f;
double d=1.12546;
double result=(a*s)+(i/f)+(d*i);
System.out.println(result);
}
}
Output:
62878.36471875
Here,
•Expression contains largest type double, so result type must be double
•a*s becomes int so a*s=50000
•In i/f, f is float so every thing becomes float so i/f=1004.7619f
•In d*i, everything becomes double so d*i=11873.603
42. Operators
An operator is a symbol which refers the type of calculation to be performed in any
operation. Eg. +,-,* etc
An operand is the value or variable used with operators.
Eg.5+6 here 5 and 6 are operands
An accumulator is a variable which holds(accumulates) the result returned by an
expression.
Eg. x=y+6 , here x is an accumulator
A Binary operator takes two or more operand. Eg, + requires two or more values.
6+10
Unary operator takes single operand, eg c++; here ++ takes single operand called c.
43. Types of operators
•Arithmetic Operators
Performs arithmetic operations.
+,-,*,/,%(modulus)
•Arithmetic and assignment operators
• ++(increment) ++a, pre increment, a++ post increment
• --(decrement) --a, pre decrement --a pre decrement
•+= addition assignment
•-= subtraction assignment
•*= multiplication assignment
•/= division assignment
•%= modulus assignment
•Bitwise operators: These operators perform operation upon individual bits.
•& (Bitwise AND) 5 & 6=4
101 & 110=100
• | (bitwise or)
•~ bitwise NOT
•^ bitwise XOR 5^6=3
•101 ^110=011
44. Types of operators
>>(Bitwise right shift) 5>>2= 0 0000101>>2 = 00000001|01(01 is out)
<<(Bitwise left shift) 5<<2= 0 0000101<<2 =20 00|00010100 (00 is
out)
>>>(Unsigned right shift)-- above operators preserve sign but this does not care sign.
Int a=-124;
Int b=a>>>3;
Here 1 0000100>>>3 red means - sign
0001 000|100>>>3 (so -16) green means out
45. Types of operators
An operator is a symbol which refers the type of calculation to be performed in any
operation. Eg. +,-,* etc
An operand is the value or variable used with operators.
Eg.5+6 here 5 and 6 are operands
An accumulator is a variable which holds(accumulates) the result returned by an
expression.
Eg. x=y+6 , here x is an accumulator
A Binary operator takes two or more operands. Eg, + requires two or more values.
6+10
Unary operator takes single operand, eg c++; here ++ takes single operand called c.
46. Types of operators
How bitwise operators differ from other operators ? (QB)
Bitwise operators are special type of operators which perform operation for single bit.
This helps to manipulate each individual bit easily. There are many bitwise operators.
& (bitwise AND), ~ (Bitwise NOT), |(Bitwise OR), ^(Bitwise XOR), >> (right Shift),
<<(Left Shift) etc.
For example:
class Test{
public static void main(String args[]) {
int x=5;
int y=6;
int z=x & y;
System.out.println(“Z is “+z);
}
}
Here
5 means 101
6 means 110
Anding 100 means 4
This program outputs 4
47. Types of operators
How bitwise operators differ from other operators ? (QB) continued..
Other operators use operand as single number. These perform arithmetic and other
logical type of operations.
Eg int x=5;
int y=6;
int z=x+y;
Here z becomes 11
48. Types of operators
Post increment Vs. Pre increment ?
The increment and decrement operators such as ++ and – can be used before or after
operands.
If operator proceeds operand then it is pre increment or pre decrement. Pre increment
first increments the operand and returns result to the accumulator.
Eg. int x=5;
int y=++x;
Here y is 6 because when expression is called, x is first incremented and then value is
given to y.
And, Post increment has opposite nature, It first returns value to the accumulator and
the increments.
int x=5;
int y=x++;
Here y is still 5 because x first returns value to y and increments later.
49. Relational operators
Relational operators work with two operands which return either true or false but not
both.
>(Greater than)
< >= <= !=
Eg. 5>6 is false, 6<9 is true
Logical operators: These operators evaluate two or more relational operations
logically. Eg.
&& (logical AND)
|| (Logical OR)
!(Logical NOT)
Ternary operator(? :) this operator is used to evaluate an expression as if-else
statement and called ternary operator. Syntax is
<var1>=(<cond>)?<value1>:<value2>
Here, if condition becomes true, value1 will be assigned to var1 otherwise value2 will
be assigned
50. Short-Circuit Logical Operators
Java provides special version of AND(&&) or (||) as short circuit operator. Normally A
|| B gives true if one is true. So to determine the result Just it is enough to know the
value of A and no mater what B is. In the same way A && B gives false if A is false.
So java will not evaluate right hand operands if result is determined by left hand
operand. This is called short circuit operation.
Eg.
if(d!=0 && n/d>0) {
}
Here if d is 0 then d!=0 becomes false then java knows result will become false so it
will not evaluate n/d>0 this means possible runtime exception can be avoided.
If(d!=0 & n/d>0) {
}
Here both operands are evaluated so runtime error may occur if d is 0
51. Short-Circuit Logical Operators
public class First {
public static void main(String args[]) {
int d=10;
int n=100;
if(d!=0 && n/d>5){
System.out.println(n/d);
}
else
{
System.out.println("Division not possible");
}
}
}
public class First {
public static void main(String args[]) {
int d=0;
int n=100;
if(d!=0 && n/d>5){
System.out.println(n/d);
}
else
{
System.out.println("Division not possible");
}
}
}
public class First {
public static void main(String args[]) {
int d=10;
int n=100;
if(d!=0 & n/d>5){
System.out.println(n/d);
}
else
{
System.out.println("Division not possible");
}
}
}
public class First {
public static void main(String args[]) {
int d=0;
int n=100;
if(d!=0 & n/d>5){
System.out.println(n/d);
}
else
{
System.out.println("Division not possible")
}
}
}
53. Operator Precedence Order
Order
[], (),.
++,--,~,!
* , /, %
+, -
>>, <<,>>>
>, <, >=, <=
==, !=
&
^
|
&&
||
?:
=
What is operator precedence? What is the use
of? Operator. Give an example.QB
Operator precedence refers the order of
execution of operators in the given expression. It
tells which operator is used first in an
expression.
?: operator is used to evaluate an expression as
if-else statement and called ternary operator.
Syntax is
<var1>=(<cond>)?<value1>:<value2>
class Precedence{
public static void main(String args[]) {
int salary=10000;
int
tax=(salary>5000)?salary*10/100:salary*5/100;
System.out.println("Tax is "+tax);
}}
54. Control Structure
What are control flow statements?
Control flow refers the flow(path) of execution of program instructions. Normally all
programs have sequential flow where statements are executed from one after another.
But Java (like other programming language) provides the way to control that flow by
using control statements.
Java provides conditional control statements for selection(if,switch) statements, for
looping(for,while,do) and Unconditional branching statements like (break, continue,
return).
Selective Statements:
If construct:
It takes a condition and performs selection on the basis of result.
Syntax:
1) Single If : if(<condition>)
task1;
task2;
here task1 will only be selected if condition is true.
55. Control Structure
2) Single If-else : if(<condition>)
task1;
else
task2;
task3;
here task1 will only be selected if condition is true otherwise task2; but not
task3;
3) Block If : It allows us to execute multiple lines of code if condition satisfies or
dissatisfies.
if(<condition>){
task1;
task2;
}
if(<condition>){
task1;
task2;
}
else
{
task3;
task4;
}
56. Example:
//class name is Selection so save file as Selection.java
class Selection {
public static void main(String args[]) {
int age=10;
if(age>=18)
System.out.println(“You can vote”);
else
System.out.println(“You can not vote”);
}
}
57. Nested if
When if statement contains another if inside, this is called nested if. When else
statement is used with other multiple if, it refers nearest if.
class Nested{
public static void main(String args[]) {
int a=5,b=6,c=7,x,y;
if(a==5) {
if(b<20) x=b;
if(c>100)y=c;
else y=b;
}
}
}
*Here else is related to nearest if, marked with red color
58. public class First {
public static void main(String args[]) {
int m=75,s=40,e=18,c=19;
int t=m+s+e+c;
String div=null;
float p=t/4;
if(p>=80)
{
div="Dist";
}
else
{
if(p>=60){
div="First";
}
else
{
if(p>=50){
div="Second";
}
else
{
div="Third";
}
}
}
System.out.println("You got "+div+" Division");
}
}
59. Switch
switch statement in java performs the task similar to multiple if-else. It takes an
expression and performs branching. Switch needs break for branching which
means jumping out. The expression must be byte,short,int,char only. We can also
use nested switch.
Syntax:
switch(expression)
{
case value1:
task1;
break;
case value2:
task2;
break;
.
.
.
default:
task;
}
60. public class First {
public static void main(String args[]) throws IOException {
int day=5;
switch(day) {
case 1:
System.out.println("Sunday");
break;
case 2:
System.out.println("Monday");
break;
case 3:
System.out.println("Tuesday");
break;
case 4:
System.out.println("Wednesday");
break;
case 5:
System.out.println("Thursday");
break;
case 6:
System.out.println("Friday");
break;
default:
System.out.println("Saturday");
}
}
}
61. Looping(Iteration)
Looping is the process of executing one or more statements repetitively for
number of times . Looping continues as long as the condition is satisfied.
1) for loop:
for(init; condition; increment/decrement)
task;
Or
for(init; condition; increment/decrement) {
task1;
task2;
}
Where init is initial value
62. Example
Wap to print 1,11,111 upto 8th term (QB)
public class First {
public static void main(String args[]) throws IOException {
int num=1,i;
for(i=1; i<=8; i++){
System.out.println(num+"t");
num=num*10+1;
}
}
}
63. While Loop
While loop checks condition first and performs repetition if condition remains
true.
Syntax:
Initialization
While(condition)
{
tasks;
increment/decreement
}
Eg. Print numbers from 1 to 100;
int n=1;
while(n<=100)
{
System.out.println(n);
n++;
}
64. While Loop
Wap to find the sum of digits of given Number(QB)
public class DigitSum{
public static void main(String args[]) {
int n=123;
int s=0,r;
while(n>0){
r=n%10;
s=s+r;
n=n/10;
}
System.out.println(s);
}
}
65. Do Loop
Do loop checks condition at last and continues repetition if condition remains true.
So if initially condition is false, loop executes at least once.
Syntax:
Initialization
do
{
tasks;
increment/decreement
} while(condition)
Eg. Print numbers from 1 to 100;
int n=1;
do
{
System.out.println(n);
n++;
} while(n<=100)
66. Do Loop
Wap to reverse the given digit
public class DigitSum{
public static void main(String args[]) {
int n=123;
int s=0,r;
while(n>0){
r=n%10;
s=s*10+r;
n=n/10;
}
System.out.println(s);
}
}
67. Nested Loop
If one looping statement contains another loop inside, it is called nested loop.
When for uses another for then that is called nested for.
for(…………………………..) {
for(…………………..){
task;
}
}
If outer executes 5 times and inner loop has 4 times then outer repeats inner 5 times in
each loop. So total loop will be 5x4=20 times
Class Nested{
for(int i=1; i<=5; i++){
for(j=1; j<=4; j++){
System.out.println(“nested loop, I is “+i+” j is “+j);
}
}
}
Output :
68. Nested Loop
Nested loop, I is 1 j is 1
Nested loop, I is 1 j is 2
Nested loop, I is 1 j is 3
Nested loop, I is 1 j is 4
Nested loop, I is 2 j is 1
Nested loop, I is 2 j is 2
Nested loop, I is 2 j is 3
Nested loop, I is 2 j is 4
Nested loop, I is 3 j is 1
Nested loop, I is 3 j is 2
Nested loop, I is 3 j is 3
Nested loop, I is 3 j is 4
Nested loop, I is 4 j is 1
Nested loop, I is 4 j is 2
Nested loop, I is 4 j is 3
Nested loop, I is 4 j is 4
Nested loop, I is 5 j is 1
Nested loop, I is 5 j is 2
Nested loop, I is 5 j is 3
Nested loop, I is 5 j is 4
69. Using comma with for
Rewrite the program to reverse number
public class First {
public static void main(String args[]) {
int n,s;
int r;
for(n=123,s=0; n>0; n=n/10){
r=n%10;
s=s*10+r;
}
System.out.println(s);
}
}
Output: 321
70. Jump Statements
Java provides following jump statements:
1) break: this statement is used to exit from a loop. break statement can also be used to
exit from certain block.
Syntax:
break;
Or
break block_name;
class First {
public static void main(String args[]) {
for(int i=1; i<=100; i++){
System.out.print (i+” “);
if(i==5) break;
}
}
}
1 2 3 4 5
71. Jump Statements
Java provides following jump statements:
2) continue: This statement forces to skip remaining code in the loop and continue to
early part of loop.
continue;
class First {
public static void main(String args[]) {
for(int i=1; i<=10; i++){
if(i==5) continue;
// 5 will not be printed because next code will be skipped
System.out.print (i+” “);
}
}
}
1 2 3 4 6 7 8 9 10
72. Jump Statements
Java provides following jump statements:
3) return: This statement is used to return from function body. This causes remaining
code ina function to be skipped.
class First {
public static void main(String args[]) {
System.out.print ("Hello");
if(true) return;
System.out.print ("Hi");
}
}
Output:
Hello
73. Arrays
An array is a group of variables which are referred by common name. An array can
hold multiple values of similar type which can be accessed by using index.
• One dimensional Array: This type of array holds single row of data.
Declaring an array:
Syntax:
type var_name[]
Eg. int nums[];
Allocating Memory:
var_name=new type[size];
eg;.
nums=new int[10];
Direct method:
int nums[]=new int[10];
Alternate Direct method:
int[] nums=new int[10];
75. Arrays
Example:
class First {
public static void main(String args[]) {
int[] odds={1,3,5,7,9};
int i;
for(i=0; i<odds.length;i++){
System.out.println(odds[i]);
}
}
}
Multidimensional Array: Multidimensional Array holds values in tabular format.
It is actually an array of arrays. To declare multidimensional array, we need to use
multiple sets of brackets. []
Example:
int a[][]=new int[2][3];
Or
int[][] a=new int[2][3];
76. Arrays
Assigning values in multi-dimensional array.
int a[][]={
{1,3,5},
{4,8,9}
};
Here
a[0][0] is 1 a[0][1] is 3 a[0][2] is 5
a[1][0] is 4 a[1][1] is 8 a[1][2] is 9
77. Arrays
Example:
class First {
public static void main(String args[]) {
int i,j;
int n[][]={
{1,8,7},
{2,5,9}
};
for(i=0; i<2; i++)
{
for(j=0; j<3; j++)
{
System.out.println(n[i][j]);
}
}
}
}
78. Variable size array
Variable size array is a type of multi-dimensional array where number of array elements
are not equal.
Wap to print following array (QB)
Int[][] a={{1,2,3},{4,5},{6,7,8,9,10,11},{12},{13,14}};
class First {
public static void main(String args[]) {
int[][] a={{1,2,3},{4,5},{6,7,8,9,10,11},{12},{13,14}};
int i;
for(i=0; i<4;i++){
for(int j=0; j<odds[i].length; j++){
System.out.print(odds[i][j]);
}
System.out.print("n");
}
}
}
79. Classes and methods
•Using Methods in a class requires :
•Method return type eg. Int float,char,void etc
•Function name
Syntax:
type methodName(paramater list) {
return value;
}
Here return is not required if method is defined with void keyword.
Parameter is the variable which is used to pass values inside methods.
80. Classes and methods
class First {
public static void main(String args[]) {
First obj=new First();
obj.greetings();
int result=obj.sum(55,50);
System.out.println("Sum is "+result);
}
void greetings(){
System.out.println("Hi, Good Morning n");
}
int sum(int a, int b){
return a+b;
}
}
Output:
Hi, Good Morning
Sum is 105
81. Classes and methods
In this example, obj is the instance of class First. We can access methods of First using . (dot)
operator. This example uses two functions. Greetings() uses void so no return is required and sum
uses return type as int and two parameters also.
new operator: This operator dynamically allocates memory for an object. It allocates memory
during runtime. When memory is insufficient then outOfMemory exception is raised.
82. Classes and methods
class MyRectangle{
int l;
int b;
void area(){
int a=l*b;
System.out.println("Area is "+a);
}
}
class First {
public static void main(String args[]) {
MyRectangle big,small; //declare reference object
big=new MyRectangle(); // allocate memory to big object
big.l=20;
big.b=15;
big.area();
small=new MyRectangle();
small.l=5;
small.b=3;
small.area();
}
}
Area is 300
Area is 15
83. Constructor
Constructor is similar to method but it is called automatically when object of the class is created. A constructor
has similar name to class. It is used to initialize the values upon creation of object. A constructor can take
parameters also. Consructor can also be overloaded.
class MyRectangle{
MyRectangle(){
System.out.println("Object created");
}
}
class First {
public static void main(String args[]) {
MyRectangle a;
a=new MyRectangle(); // here constructor is called
}
}
Output:
Object Created
84. Parameterized Constructor
class MyRectangle{
int length,breadth;
MyRectangle(int l,int b){
length=l;
breadth=b;
}
int area(){
return length*breadth;
}
int perimeter(){
return 2*(length+breadth);
}
}
class First {
public static void main(String args[]) {
MyRectangle a;
a=new MyRectangle(5,10); // here constructor is called
System.out.println("Area is "+a.area());
System.out.println("Perimeter is "+a.perimeter());
}
}
Area is 50
Perimeter is 30