This begins your journey to java as a very beginner. Prerequisite of the audience is strong understanding of basic language fundamentals of C or C++ or C# .
This shows how one can use XMPP in one's Java coding to make an IM communication. It'd be really amusing to see your Facebook or Google chat in action with your own code.
Protocol Buffers are a language-neutral, platform-neutral way of serializing structured data. They were developed at Google to address issues with encoding structured data for communication between systems. Protocol Buffers define the data structure in a .proto file, which is then used to generate code for easily reading and writing the structured data in multiple languages. They provide a smaller data size and faster parsing than XML and allow the data structure to be updated while maintaining backwards and forwards compatibility.
This presentation provides the information on python including the topics Python features, applications, variables and operators in python, control statements, numbers, strings, print formatting, list and list comprehension, dictionaries, tuples, files, sets, boolean, mehtods and functions, lambda expressions and a sample project using Python.
The document discusses Java programming concepts such as classes, methods, strings, comments, and identifiers. It provides examples of Java code that declare classes with a main method and static methods that are called from main. It explains how to write comments to document code and describes syntax rules for identifiers, keywords, and strings. The document is intended to teach programmers how to write, compile, and run basic Java programs.
This document discusses serialization and protocol buffers. It describes serialization as encoding objects into a stream of bytes for persistence. Protocol buffers provide a compact binary format for serialization that is language and platform neutral. It involves defining message formats in .proto files, then using the protocol buffer compiler to generate classes for parsing and serializing the data. Key advantages are strong typing, version tolerance, and high performance.
This document provides an introduction to Java programming concepts such as data types, variables, operators, input/output, control flow, methods, and classes. It explains what computer science and programming are, gives examples of basic Java programs using print statements, and discusses programming fundamentals like program structure, naming conventions, comments, and static methods. Methods are introduced as a way to organize code and eliminate redundancy. Overall, the document orients the reader to fundamental Java programming concepts.
The document provides an overview of object oriented programming and network programming concepts. It discusses topics like IP addresses, ports, sockets, client-server programming, and the java.net and java.util packages. The java.net package contains classes for network programming in Java like Socket, ServerSocket, URL, and InetAddress. The java.util package contains general-purpose utility classes like ArrayList, HashMap, Properties and Date.
Augmenting and structuring user queries to support efficient free-form code s...Dongsun Kim
Presented at the 40th International Conference on Software Engineering, May 27 - 3 June 2018, Gothenburg, Sweden (ICSE 2018) as Journal first publication.
Java was created in 1991 by James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems. It has three editions: Java ME for limited devices, Java SE as the core platform for desktops and servers, and Java EE for large enterprise applications. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM) making Java portable across platforms. Key principles of Java include being object-oriented, secure, and platform independent.
The document discusses multithreading and threading concepts in Java. It defines a thread as a single sequential flow of execution within a program. Multithreading allows executing multiple threads simultaneously by sharing the resources of a process. The key benefits of multithreading include proper utilization of resources, decreased maintenance costs, and improved performance of complex applications. Threads have various states like new, runnable, running, blocked, and dead during their lifecycle. The document also explains different threading methods like start(), run(), sleep(), yield(), join(), wait(), notify() etc and synchronization techniques in multithreading.
Threads allow multiple tasks to run concurrently within a single process. Each thread has its own call stack and shares resources like memory with other threads in the same process. There are two main ways to implement threads in Java - by extending the Thread class or implementing the Runnable interface. Synchronization is needed when multiple threads access shared resources to prevent data corruption. Common methods like start(), join(), sleep() and priority help control thread execution and behavior.
Reverse-engineering: Using GDB on LinuxRick Harris
At Holberton School, we have had a couple rounds of a ‘#forfun’ project called crackme. For these projects, we are given an executable that accepts a password. Our assignment is to crack the program through reverse engineering.
This is one of my old slide. I took an one day class in BRAC University in 2007 on taking input in Java programming language. This tutorial is for begginer studemts.
This document discusses C# threads and threading concepts in 3 paragraphs:
C# threads are managed by the System.Threading.Thread class and are passed a function using a ThreadStart delegate. Threads can be started and have properties like IsBackground that indicate their state.
When threads share resources, synchronization is needed to serialize access. The C# lock statement can be used to synchronize access to shared resources like queues. Other synchronization primitives like Monitor, Interlocked, and ReaderWriterLock are also available.
User interface threads in Windows Forms are separate from worker threads that do background processing. Worker threads must communicate with UI threads using Form methods like Invoke, BeginInvoke, and EndInvoke
This document contains lecture notes on Java programming divided into 6 units. Unit 1 provides an overview of Java and covers data types, variables, arrays, operators, control statements and classes. It also discusses I/O operations like reading console input/output and files. Unit 2 covers string handling and the StringBuffer class. Unit 3 discusses packages, interfaces and exception handling. Unit 4 focuses on multithreading concepts. Unit 5 covers applets, event handling and the Abstract Window Toolkit. Unit 6 introduces Swing and JDBC. The document also includes examples of Java programs and lists lab experiments and reference books.
Don't be fooled by the thumbnail - the first couple of slides are a silly joke I forgot to remove before uploading.
Presentation derived from the "What's new in Python 2.4" document on http://www.python.org/ including much reformatting for presenting and presenter notes.
Please download the Keynote original - that way the presentation notes aren't burned into the slides.
This document discusses multithreading in C#. It introduces threads and multithreading, describing how operating systems allow multitasking and how threads work. It explains that the .NET Framework supports multithreading using the System.Threading namespace and Thread class. It describes properties and methods of the Thread class, potential problems like deadlocks that can occur with multithreading, and solutions like synchronization and locking to prevent issues.
This document provides information on multithreading, networking, and other Java concepts. It discusses how to create threads in Java by extending the Thread class or implementing Runnable, and describes methods like sleep(), wait(), notify() etc. It also covers networking topics like sockets, servers, clients and protocols. Examples of socket programming and a chatting program using sockets are included. Finally, it discusses classes like URL, URLConnection and HttpURLConnection for working with URLs.
Threads And Synchronization in C#
Concept about Threads And Synchronization in C#
it will help you about this concept
feel free
Download free programming applications on
http://www.androidapplications.xyz
Std 12 Computer Chapter 7 Java Basics (Part 1) by Nuzhat Memon
Introduction to Java
Java Development Kit (JDK)
Java Runtime Environment (JRE)
java is a platform independent
Bytecode in java
java interpreter
Structure of a java program
literals in java
3 kinds of comments in java (single line comment, multiline comment, documentation comment)
Expression in java
Operator in java
Looping in java
continue and break statement in java
gseb computer paper solution 2020 english medium
This document provides an overview of sockets programming in Python. It discusses:
1) The basic Python sockets modules (Socket and SocketServer) which provide low-level networking and simplified server development.
2) Examples of creating stream and datagram sockets, binding addresses, listening for connections, and accepting clients.
3) How the SocketServer module simplifies creating TCP servers with a basic "Hello World" example server.
This document contains 35 PHP interview questions and their answers. Some key details include:
- Rasmus Lerdorf is the father of PHP.
- $name is a variable while $$name is a reference variable.
- Forms can be submitted via GET and POST methods.
- Sessions are used to store temporary data across page requests and are closed when the browser closes.
- Variables can be passed between pages via the session, cookies, or URL parameters.
- Sizeof() and count() can be used to find the number of elements in an array.
- Functions like mysql_create_db() can be used to create databases from PHP.
This document discusses sending emails using Python's SMTP module. It explains that SMTP is used to send and route emails between servers. The smtplib module defines an SMTP client session object that can be used to send mail. It provides an example of using smtplib to send an email by specifying the sender, receivers, and message. It also shows how to send an HTML email by setting the MIME version, content type, and character set in the message.
The document discusses various Java concurrency concepts including threads, locks, semaphores, and concurrent collections. It provides examples to illustrate thread synchronization issues like race conditions and deadlocks. It also demonstrates how to use various concurrency utilities from java.util.concurrent package like CountDownLatch, Exchanger, PriorityBlockingQueue to synchronize thread execution and communication between threads. The examples show how to simulate real world scenarios involving multiple threads accessing shared resources in a synchronized manner.
This document provides an introduction to Python programming. It discusses that Python is an interpreted, object-oriented, high-level programming language with simple syntax. It then covers the need for programming languages, different types of languages, and translators like compilers, interpreters, assemblers, linkers, and loaders. The document concludes by discussing why Python is popular for web development, software development, data science, and more.
Multithreading allows programs to have multiple threads that can run concurrently. Each thread defines a separate path of execution. Processes are programs that are executing, while threads exist within a process and share its resources. Creating a new thread requires fewer resources than creating a new process. There are two main ways to define a thread - by implementing the Runnable interface or by extending the Thread class.
The document provides an introduction to the Java programming language. It discusses Java's history and key editions. It also covers basic Java concepts like compiling and running a simple "Hello World" program, primitive data types, variables, operators, conditional statements like if/else, and iterative structures like the for loop. Examples are provided throughout to demonstrate syntax and output.
This has been presented in association with Robosepians for Java concepts. Basic concepts of Java including features, conditional statements, loop statements, arrays, string, primitive datatypes, essentials of Java including oops concepts, classes, objects, polymorphism, advance topics including packages, exception handling, multihtreading and network programming have been discussed.
Java was created in 1991 by James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems. It has three editions: Java ME for limited devices, Java SE as the core platform for desktops and servers, and Java EE for large enterprise applications. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM) making Java portable across platforms. Key principles of Java include being object-oriented, secure, and platform independent.
The document discusses multithreading and threading concepts in Java. It defines a thread as a single sequential flow of execution within a program. Multithreading allows executing multiple threads simultaneously by sharing the resources of a process. The key benefits of multithreading include proper utilization of resources, decreased maintenance costs, and improved performance of complex applications. Threads have various states like new, runnable, running, blocked, and dead during their lifecycle. The document also explains different threading methods like start(), run(), sleep(), yield(), join(), wait(), notify() etc and synchronization techniques in multithreading.
Threads allow multiple tasks to run concurrently within a single process. Each thread has its own call stack and shares resources like memory with other threads in the same process. There are two main ways to implement threads in Java - by extending the Thread class or implementing the Runnable interface. Synchronization is needed when multiple threads access shared resources to prevent data corruption. Common methods like start(), join(), sleep() and priority help control thread execution and behavior.
Reverse-engineering: Using GDB on LinuxRick Harris
At Holberton School, we have had a couple rounds of a ‘#forfun’ project called crackme. For these projects, we are given an executable that accepts a password. Our assignment is to crack the program through reverse engineering.
This is one of my old slide. I took an one day class in BRAC University in 2007 on taking input in Java programming language. This tutorial is for begginer studemts.
This document discusses C# threads and threading concepts in 3 paragraphs:
C# threads are managed by the System.Threading.Thread class and are passed a function using a ThreadStart delegate. Threads can be started and have properties like IsBackground that indicate their state.
When threads share resources, synchronization is needed to serialize access. The C# lock statement can be used to synchronize access to shared resources like queues. Other synchronization primitives like Monitor, Interlocked, and ReaderWriterLock are also available.
User interface threads in Windows Forms are separate from worker threads that do background processing. Worker threads must communicate with UI threads using Form methods like Invoke, BeginInvoke, and EndInvoke
This document contains lecture notes on Java programming divided into 6 units. Unit 1 provides an overview of Java and covers data types, variables, arrays, operators, control statements and classes. It also discusses I/O operations like reading console input/output and files. Unit 2 covers string handling and the StringBuffer class. Unit 3 discusses packages, interfaces and exception handling. Unit 4 focuses on multithreading concepts. Unit 5 covers applets, event handling and the Abstract Window Toolkit. Unit 6 introduces Swing and JDBC. The document also includes examples of Java programs and lists lab experiments and reference books.
Don't be fooled by the thumbnail - the first couple of slides are a silly joke I forgot to remove before uploading.
Presentation derived from the "What's new in Python 2.4" document on http://www.python.org/ including much reformatting for presenting and presenter notes.
Please download the Keynote original - that way the presentation notes aren't burned into the slides.
This document discusses multithreading in C#. It introduces threads and multithreading, describing how operating systems allow multitasking and how threads work. It explains that the .NET Framework supports multithreading using the System.Threading namespace and Thread class. It describes properties and methods of the Thread class, potential problems like deadlocks that can occur with multithreading, and solutions like synchronization and locking to prevent issues.
This document provides information on multithreading, networking, and other Java concepts. It discusses how to create threads in Java by extending the Thread class or implementing Runnable, and describes methods like sleep(), wait(), notify() etc. It also covers networking topics like sockets, servers, clients and protocols. Examples of socket programming and a chatting program using sockets are included. Finally, it discusses classes like URL, URLConnection and HttpURLConnection for working with URLs.
Threads And Synchronization in C#
Concept about Threads And Synchronization in C#
it will help you about this concept
feel free
Download free programming applications on
http://www.androidapplications.xyz
Std 12 Computer Chapter 7 Java Basics (Part 1) by Nuzhat Memon
Introduction to Java
Java Development Kit (JDK)
Java Runtime Environment (JRE)
java is a platform independent
Bytecode in java
java interpreter
Structure of a java program
literals in java
3 kinds of comments in java (single line comment, multiline comment, documentation comment)
Expression in java
Operator in java
Looping in java
continue and break statement in java
gseb computer paper solution 2020 english medium
This document provides an overview of sockets programming in Python. It discusses:
1) The basic Python sockets modules (Socket and SocketServer) which provide low-level networking and simplified server development.
2) Examples of creating stream and datagram sockets, binding addresses, listening for connections, and accepting clients.
3) How the SocketServer module simplifies creating TCP servers with a basic "Hello World" example server.
This document contains 35 PHP interview questions and their answers. Some key details include:
- Rasmus Lerdorf is the father of PHP.
- $name is a variable while $$name is a reference variable.
- Forms can be submitted via GET and POST methods.
- Sessions are used to store temporary data across page requests and are closed when the browser closes.
- Variables can be passed between pages via the session, cookies, or URL parameters.
- Sizeof() and count() can be used to find the number of elements in an array.
- Functions like mysql_create_db() can be used to create databases from PHP.
This document discusses sending emails using Python's SMTP module. It explains that SMTP is used to send and route emails between servers. The smtplib module defines an SMTP client session object that can be used to send mail. It provides an example of using smtplib to send an email by specifying the sender, receivers, and message. It also shows how to send an HTML email by setting the MIME version, content type, and character set in the message.
The document discusses various Java concurrency concepts including threads, locks, semaphores, and concurrent collections. It provides examples to illustrate thread synchronization issues like race conditions and deadlocks. It also demonstrates how to use various concurrency utilities from java.util.concurrent package like CountDownLatch, Exchanger, PriorityBlockingQueue to synchronize thread execution and communication between threads. The examples show how to simulate real world scenarios involving multiple threads accessing shared resources in a synchronized manner.
This document provides an introduction to Python programming. It discusses that Python is an interpreted, object-oriented, high-level programming language with simple syntax. It then covers the need for programming languages, different types of languages, and translators like compilers, interpreters, assemblers, linkers, and loaders. The document concludes by discussing why Python is popular for web development, software development, data science, and more.
Multithreading allows programs to have multiple threads that can run concurrently. Each thread defines a separate path of execution. Processes are programs that are executing, while threads exist within a process and share its resources. Creating a new thread requires fewer resources than creating a new process. There are two main ways to define a thread - by implementing the Runnable interface or by extending the Thread class.
The document provides an introduction to the Java programming language. It discusses Java's history and key editions. It also covers basic Java concepts like compiling and running a simple "Hello World" program, primitive data types, variables, operators, conditional statements like if/else, and iterative structures like the for loop. Examples are provided throughout to demonstrate syntax and output.
This has been presented in association with Robosepians for Java concepts. Basic concepts of Java including features, conditional statements, loop statements, arrays, string, primitive datatypes, essentials of Java including oops concepts, classes, objects, polymorphism, advance topics including packages, exception handling, multihtreading and network programming have been discussed.
This document provides an introduction to Java programming. It discusses learning about creating Java programs, including input, output, branching, looping, and the history of Java's development. Operators, decision making constructs like if/else statements, and loops like for and while are also covered. The reader will learn the basics of writing Java programs.
Java allows writing code once that can run on any platform. It compiles to bytecode that runs on the Java Virtual Machine (JVM). Key features include automatic memory management, object-oriented design, platform independence, security, and multi-threading. Classes are defined in .java files and compiled to .class files. The JVM interprets bytecode and uses just-in-time compilation to improve performance.
- Java is a platform independent programming language that is similar to C++ in syntax but similar to Smalltalk in its object-oriented approach. It provides features like automatic memory management, security, and multi-threading capabilities.
- Java code is compiled to bytecode that can run on any Java Virtual Machine (JVM). Only depending on the JVM allows Java code to run on any hardware or operating system with a JVM.
- Java supports object-oriented programming concepts like inheritance, polymorphism, and encapsulation. Classes can contain methods and instance variables to define objects.
- Java is a platform independent programming language that is similar to C++ in syntax but similar to Smalltalk in its object-oriented approach. It provides features like automatic memory management, security, and multi-threading capabilities.
- Java code is compiled to bytecode that can run on any Java Virtual Machine (JVM). The JVM then interprets the bytecode and may perform just-in-time (JIT) compilation for improved performance. This allows Java programs to run on any platform with a JVM.
- Java supports object-oriented programming principles like encapsulation, inheritance, and polymorphism. Classes can contain methods and instance variables. Methods can be called on objects to perform operations or retrieve data.
- Java is a platform independent programming language that is similar to C++ in syntax but similar to Smalltalk in its object-oriented approach. It provides features like automatic memory management, security, and multi-threading capabilities.
- Java code is compiled to bytecode that can run on any Java Virtual Machine (JVM). Only depending on the JVM allows Java code to run on any hardware or operating system with a JVM.
- Java supports object-oriented programming concepts like inheritance, polymorphism, and encapsulation. Classes can contain methods and instance variables. Methods perform actions and can return values.
This document contains lecture notes on Java programming divided into 6 units. Unit 1 provides an introduction to Java including an overview of data types, variables, arrays, operators, control statements, classes and objects, and input/output. It also covers inheritance, abstract classes, and the object class. Subsequent units cover topics like string handling, packages, interfaces, exception handling, multithreading, applets, event handling, AWT, Swings, and JDBC. Examples of Java programs and potential errors are also provided.
This document provides an overview of the Java programming language. It discusses topics such as how Java code is compiled and run, Java's platform independence, object-oriented features like inheritance and polymorphism, basic syntax like variables and loops, and input/output stream manipulation. The document is intended as a tutorial or introduction to Java for learning purposes.
This document provides an overview of the Java programming language. It discusses key Java concepts like object-oriented programming, classes, methods, streams, and input/output. It also covers Java syntax like primitive types, variables, operators, flow control, and arrays. The document explains how Java code is compiled to bytecode and run on the Java Virtual Machine, making it platform independent.
This talk introduces the core concepts of functional programming, why it matters now and how these principles are adopted for programming.
Beyond the usage of the functional principles for programming in the small, their applicability to the design of components and further on to the architecture of software systems is also explored along with relevant examples.
The code samples used in the talk are in Haskell / Java 8 / Scala / Elm and JavaScript, but deep understanding of any of these languages are not a pre-requisite.
This document provides an introduction and overview of the Java programming language. It discusses Java's history and key features such as being object-oriented, platform independent, and designed for robustness and security. It also covers Java variables, operators, decision-making structures like if/else statements, and loops like for and while.
Java is a programming language that is simple, object-oriented, and robust. It allows programs to be portable across platforms and provides automatic memory management through garbage collection. Key features of Java include its platform independence through bytecode, its object-oriented approach, networking capabilities, security features, performance through just-in-time compilation, and support for multithreading. Java code is compiled to bytecode that can run on any Java Virtual Machine, making programs highly portable.
This document provides an introduction to learning Java, including:
- An overview of Java as an object-oriented language developed by Sun Microsystems, featuring a virtual machine, portability, and memory management.
- Instructions for compiling and running a simple "Hello World" Java program from the command line.
- Explanations of Java programming basics like classes, methods, variables, operators, and control structures.
Java programing language unit 1 introductionchnrketan
This document provides an overview of key Java concepts including:
- Java is a popular, platform-independent object-oriented programming language.
- Key Java features include being object-oriented, having automatic memory management, and using a virtual machine.
- Core Java topics covered include arrays, strings, classes, objects, methods, and exceptions.
The document provides an overview of functional programming concepts in Java 8. It discusses how functions are now first-class citizens in Java that can be passed as parameters and returned from other functions. Lambda expressions are introduced as anonymous functions that can be used to concisely represent implementations of functional interfaces. The document also discusses how lambda expressions are compiled using invokedynamic rather than by converting them to anonymous inner classes, and how this allows them to be more efficient. Finally, it covers additional Java 8 features like streams that further support a functional style of programming.
This document provides an overview of key Java concepts including:
- Java is an object-oriented, platform-independent programming language similar to C++ in syntax. It was developed by Sun Microsystems.
- Java features include automatic memory management, type safety, multi-threading, and network programming capabilities. Code is compiled to bytecode that runs on the Java Virtual Machine.
- Core Java concepts discussed include primitive types, variables, operators, control flow statements, methods, classes, objects, arrays, inheritance, polymorphism and encapsulation.
- Additional topics covered are packages, access modifiers, constructors, overloading, overriding, and inner classes.
This document provides an introduction to the Java programming language concepts covered in the CAP615: Programming in Java course. It discusses computer programs and the Java language features like being easy to develop, platform independent, portable, multithreaded, distributed and object oriented. It also covers Java development environment, running and testing programs, classes and objects, defining fields and methods, variables, strings, numbers, operators, if/else statements and loops.
The document discusses different approaches to method level security in Spring Security including @PreAuthorize, @PostAuthorize, @PreFilter, and @PostFilter annotations. @PreAuthorize allows restricting access to methods based on roles or expressions while @PostAuthorize controls access based on method return values. @PreFilter and @PostFilter can filter collections passed as method parameters or returned.
This document discusses creating a secured Spring MVC application with user authentication and authorization. It describes setting up a MVC application structure with JSP pages organized in folders, then adding Spring Security to restrict access to admin pages requiring login. It shows configuring security by overriding WebSecurityConfigurerAdapter methods and using ant matchers to specify URL patterns. Finally, it discusses configuring user details by adding database tables and integrating with Spring Security.
The document describes several JavaScript coding problems involving HTML forms:
1. Coding a form with 3 text fields and a button that displays the sum of the first two fields in the third read-only field when clicked.
2. Modifying the above form so that the button is initially disabled and only enabled when both first fields have values, toggling as values are added or removed.
3. Coding a form with 5 text fields that only submits when all are filled and displays an alert naming blank fields, focusing the first blank field.
4. Adding to problem 3 so that pressing return in a filled field focuses and auto-capitalizes the next field.
5. Today's
This document contains instructions for a lab assignment on computer networks. Students are asked to analyze sample IPv4 and ARP packets captured in Wireshark and answer questions about the packet headers. For the IPv4 packet, they must identify the Ethernet header length, isolate the IPv4 header, find source/destination MAC and IP addresses, and determine packet properties like the number of routers it can pass through and the identification field value. For the ARP packet, students are asked to classify it as a request or reply and identify fields that indicate the protocol, source/destination addresses, and addresses being resolved.
This document contains a lab assignment for a computers networks course. It provides 3 exercises analyzing packet headers at the Ethernet, network, and transport layers. Students are asked to extract information like source/destination addresses, protocol types, header sizes, and port numbers. They are also asked to explain the purpose of different protocols and whether one could be used for media streaming.
The document outlines the goals and topics to be covered in a lecture on data and network security. It will discuss principles of network security including cryptography, authentication, message integrity, and key distribution. It will also cover security implementations in practice such as firewalls and security at different network layers. The lecture will begin with an introduction to network security and then cover cryptography, authentication, integrity, key distribution, access control with firewalls, attacks and countermeasures, and security across network layers.
This document discusses network programming in Java. It shows how to get the local host address and address of google.com. It defines a server as a program that listens on a TCP port for connections and a client as a program that initiates connections. It demonstrates how to create a server socket to listen on a port and how a client socket can connect to an IP address and port. It also discusses Java I/O streams for input and output and how to handle files in Java including checking if a directory exists, creating it if not, opening output streams to write to files, and approaches for reading from files.
Describes Bluetooth protocol in the application layer, Uses Java to explore Bluetooth technology using JSR-82. Has separate discussions for :
1) concept of local and remote device
2) Find out your own MAC Address (Bluetooth )
3) Search for devices
4)Connect to a device over BTSPP
5) Use javax.microedition.io
6) It also works with Java ME (J2ME)
7) concept of UUID and profiles
9) It connects to DUN profile
10) Using AT commands to ethically make calls from another GSM mobile or send SMS from it
This is one of the comprehensive Java slides I made in 2008.
This covers:
a) Constructors
b) static initializers and blocks
c) non-static initializers and blocks
d) this keyword
e) chaining of constructors
This Java slides gives comprehensive understating of :
a) Inheritance
b) super keyword and constructors
c) hierarchical super constructor and execution of blocks and initilaizers
d) static methods and their speciality
e) Method overriding versus overloading
f) why static methods cannot be overridden
h) private methods : why they are not overridden
g) rules of overriding :Exceptions to be thrown
h) dynamic method dispatch what and why
Exceptions in Java occur when unexpected or abnormal conditions arise during program execution. There are two main types of exceptions: Exceptions, which can be caught and handled by the program, and Errors, which usually indicate serious problems and cannot be caught. When an exception occurs, an object is thrown which can either be handled within the method or passed to the calling method. Exceptions are typically generated by the Java runtime system but can also be manually thrown in code. Finally blocks ensure code is executed whether or not an exception occurs, such as closing open files or network connections.
Java Universal super class java.lang.Object is discussed comprehensively with code snippets.
Also covers:
a) Why we need inheritance and dynamic method dispatch
b) Need of a universal parent
c) Delegation and proxies
d) toString(), clone(), equals(), notify()
This document discusses Java Server Pages (JSP) and compares it to servlets. It outlines some drawbacks of servlets, including that web page designers need knowledge of servlets and servlets have to be recompiled for each presentation change. It then describes advantages of JSPs such as allowing dynamic web page creation through combining HTML and scripting tags. The document also covers JSP directives, implicit objects, Java beans, and standard action tags like <jsp:useBean> and <jsp:include>.
Soham Sengupta will give a presentation on surfing the web safely. He will discuss possible attacks like SQL injection, malicious cookies and software. Sengupta will demonstrate attacks and prevention mechanisms like basic cryptography. He warns about risks of using public networks, pirated software, and untrusted browsers and extensions that could steal personal information. Sengupta recommends using trusted browsers like Chrome, activating two-step authentication, and being wary of links and downloads from unknown sources to surf safely.
Comprehensive guide with code snippet that discusses:
1) how an HTML table can be used to select rows from
2) how to render a dynamic table using database
3) How and why to alternate row colors on even-'n'-odd basis
The document provides an overview of HTML (Hypertext Markup Language) and basic tags used in HTML. It discusses that HTML is used to render web pages but rendering may differ across browsers. It also mentions that HTML has no computation power so scripting languages like JavaScript are needed for user interaction. The document then goes on to explain some common HTML tags like <html>, <head>, <title>, <body> etc. and form tags like <form>, <input>, <select> and how they are used to take user input. It also provides examples of using JavaScript for basic form validation.
This document provides an overview of JavaScript fundamentals including a brief history of JavaScript, its uses, language features, inclusion of scripts in HTML documents, and the JavaScript object model. It discusses the window object and properties like location, frames, history. It also covers variables and data types, operators, control structures, arrays, functions, and communicating with the user through prompts, alerts and changing the status bar.
This document provides an overview of Asynchronous JavaScript and XML (AJAX). It discusses how AJAX allows for asynchronous data retrieval from web servers in the background without interfering with the display and behavior of the existing page. This is done using the XMLHttpRequest object to make requests and callbacks that can update portions of the page without reloading. The document covers the basic components and uses of AJAX including real-time validation, autocomplete, and updating parts of pages without reloading. It also discusses some challenges with AJAX including breaking the back button and increasing code size.
The document discusses Dynamic HTML (DHTML) which allows HTML documents to be more dynamic and interactive using technologies developed by Netscape and Microsoft. It describes DHTML features such as style sheets, content positioning, and the Document Object Model (DOM). Style sheets allow separation of content from presentation through features like CSS. Content positioning is achieved using layers in Netscape and innerHTML in Microsoft browsers. DHTML enables dynamic updating of content on a webpage.
How can one start with crypto wallet development.pptxlaravinson24
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
F-Secure Freedome VPN 2025 Crack Plus Activation New Versionsaimabibi60507
Copy & Past Link 👉👉
https://dr-up-community.info/
F-Secure Freedome VPN is a virtual private network service developed by F-Secure, a Finnish cybersecurity company. It offers features such as Wi-Fi protection, IP address masking, browsing protection, and a kill switch to enhance online privacy and security .
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDinusha Kumarasiri
AI is transforming APIs, enabling smarter automation, enhanced decision-making, and seamless integrations. This presentation explores key design principles for AI-infused APIs on Azure, covering performance optimization, security best practices, scalability strategies, and responsible AI governance. Learn how to leverage Azure API Management, machine learning models, and cloud-native architectures to build robust, efficient, and intelligent API solutions
Not So Common Memory Leaks in Java WebinarTier1 app
This SlideShare presentation is from our May webinar, “Not So Common Memory Leaks & How to Fix Them?”, where we explored lesser-known memory leak patterns in Java applications. Unlike typical leaks, subtle issues such as thread local misuse, inner class references, uncached collections, and misbehaving frameworks often go undetected and gradually degrade performance. This deck provides in-depth insights into identifying these hidden leaks using advanced heap analysis and profiling techniques, along with real-world case studies and practical solutions. Ideal for developers and performance engineers aiming to deepen their understanding of Java memory management and improve application stability.
Join Ajay Sarpal and Miray Vu to learn about key Marketo Engage enhancements. Discover improved in-app Salesforce CRM connector statistics for easy monitoring of sync health and throughput. Explore new Salesforce CRM Synch Dashboards providing up-to-date insights into weekly activity usage, thresholds, and limits with drill-down capabilities. Learn about proactive notifications for both Salesforce CRM sync and product usage overages. Get an update on improved Salesforce CRM synch scale and reliability coming in Q2 2025.
Key Takeaways:
Improved Salesforce CRM User Experience: Learn how self-service visibility enhances satisfaction.
Utilize Salesforce CRM Synch Dashboards: Explore real-time weekly activity data.
Monitor Performance Against Limits: See threshold limits for each product level.
Get Usage Over-Limit Alerts: Receive notifications for exceeding thresholds.
Learn About Improved Salesforce CRM Scale: Understand upcoming cloud-based incremental sync.
Interactive Odoo Dashboard for various business needs can provide users with dynamic, visually appealing dashboards tailored to their specific requirements. such a module that could support multiple dashboards for different aspects of a business
✅Visit And Buy Now : https://bit.ly/3VojWza
✅This Interactive Odoo dashboard module allow user to create their own odoo interactive dashboards for various purpose.
App download now :
Odoo 18 : https://bit.ly/3VojWza
Odoo 17 : https://bit.ly/4h9Z47G
Odoo 16 : https://bit.ly/3FJTEA4
Odoo 15 : https://bit.ly/3W7tsEB
Odoo 14 : https://bit.ly/3BqZDHg
Odoo 13 : https://bit.ly/3uNMF2t
Try Our website appointment booking odoo app : https://bit.ly/3SvNvgU
👉Want a Demo ?📧 [email protected]
➡️Contact us for Odoo ERP Set up : 091066 49361
👉Explore more apps: https://bit.ly/3oFIOCF
👉Want to know more : 🌐 https://www.axistechnolabs.com/
#odoo #odoo18 #odoo17 #odoo16 #odoo15 #odooapps #dashboards #dashboardsoftware #odooerp #odooimplementation #odoodashboardapp #bestodoodashboard #dashboardapp #odoodashboard #dashboardmodule #interactivedashboard #bestdashboard #dashboard #odootag #odooservices #odoonewfeatures #newappfeatures #odoodashboardapp #dynamicdashboard #odooapp #odooappstore #TopOdooApps #odooapp #odooexperience #odoodevelopment #businessdashboard #allinonedashboard #odooproducts
Adobe Lightroom Classic Crack FREE Latest link 2025kashifyounis067
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Adobe Lightroom Classic is a desktop-based software application for editing and managing digital photos. It focuses on providing users with a powerful and comprehensive set of tools for organizing, editing, and processing their images on their computer. Unlike the newer Lightroom, which is cloud-based, Lightroom Classic stores photos locally on your computer and offers a more traditional workflow for professional photographers.
Here's a more detailed breakdown:
Key Features and Functions:
Organization:
Lightroom Classic provides robust tools for organizing your photos, including creating collections, using keywords, flags, and color labels.
Editing:
It offers a wide range of editing tools for making adjustments to color, tone, and more.
Processing:
Lightroom Classic can process RAW files, allowing for significant adjustments and fine-tuning of images.
Desktop-Focused:
The application is designed to be used on a computer, with the original photos stored locally on the hard drive.
Non-Destructive Editing:
Edits are applied to the original photos in a non-destructive way, meaning the original files remain untouched.
Key Differences from Lightroom (Cloud-Based):
Storage Location:
Lightroom Classic stores photos locally on your computer, while Lightroom stores them in the cloud.
Workflow:
Lightroom Classic is designed for a desktop workflow, while Lightroom is designed for a cloud-based workflow.
Connectivity:
Lightroom Classic can be used offline, while Lightroom requires an internet connection to sync and access photos.
Organization:
Lightroom Classic offers more advanced organization features like Collections and Keywords.
Who is it for?
Professional Photographers:
PCMag notes that Lightroom Classic is a popular choice among professional photographers who need the flexibility and control of a desktop-based application.
Users with Large Collections:
Those with extensive photo collections may prefer Lightroom Classic's local storage and robust organization features.
Users who prefer a traditional workflow:
Users who prefer a more traditional desktop workflow, with their original photos stored on their computer, will find Lightroom Classic a good fit.
This presentation explores code comprehension challenges in scientific programming based on a survey of 57 research scientists. It reveals that 57.9% of scientists have no formal training in writing readable code. Key findings highlight a "documentation paradox" where documentation is both the most common readability practice and the biggest challenge scientists face. The study identifies critical issues with naming conventions and code organization, noting that 100% of scientists agree readable code is essential for reproducible research. The research concludes with four key recommendations: expanding programming education for scientists, conducting targeted research on scientific code quality, developing specialized tools, and establishing clearer documentation guidelines for scientific software.
Presented at: The 33rd International Conference on Program Comprehension (ICPC '25)
Date of Conference: April 2025
Conference Location: Ottawa, Ontario, Canada
Preprint: https://arxiv.org/abs/2501.10037
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
FL Studio Producer Edition Crack 2025 Full Versiontahirabibi60507
Copy & Past Link 👉👉
http://drfiles.net/
FL Studio is a Digital Audio Workstation (DAW) software used for music production. It's developed by the Belgian company Image-Line. FL Studio allows users to create and edit music using a graphical user interface with a pattern-based music sequencer.
Avast Premium Security Crack FREE Latest Version 2025mu394968
🌍📱👉COPY LINK & PASTE ON GOOGLE https://dr-kain-geera.info/👈🌍
Avast Premium Security is a paid subscription service that provides comprehensive online security and privacy protection for multiple devices. It includes features like antivirus, firewall, ransomware protection, and website scanning, all designed to safeguard against a wide range of online threats, according to Avast.
Key features of Avast Premium Security:
Antivirus: Protects against viruses, malware, and other malicious software, according to Avast.
Firewall: Controls network traffic and blocks unauthorized access to your devices, as noted by All About Cookies.
Ransomware protection: Helps prevent ransomware attacks, which can encrypt your files and hold them hostage.
Website scanning: Checks websites for malicious content before you visit them, according to Avast.
Email Guardian: Scans your emails for suspicious attachments and phishing attempts.
Multi-device protection: Covers up to 10 devices, including Windows, Mac, Android, and iOS, as stated by 2GO Software.
Privacy features: Helps protect your personal data and online privacy.
In essence, Avast Premium Security provides a robust suite of tools to keep your devices and online activity safe and secure, according to Avast.
Landscape of Requirements Engineering for/by AI through Literature ReviewHironori Washizaki
Hironori Washizaki, "Landscape of Requirements Engineering for/by AI through Literature Review," RAISE 2025: Workshop on Requirements engineering for AI-powered SoftwarE, 2025.
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)Andre Hora
Software testing plays a crucial role in the contribution process of open-source projects. For example, contributions introducing new features are expected to include tests, and contributions with tests are more likely to be accepted. Although most real-world projects require contributors to write tests, the specific testing practices communicated to contributors remain unclear. In this paper, we present an empirical study to understand better how software testing is approached in contribution guidelines. We analyze the guidelines of 200 Python and JavaScript open-source software projects. We find that 78% of the projects include some form of test documentation for contributors. Test documentation is located in multiple sources, including CONTRIBUTING files (58%), external documentation (24%), and README files (8%). Furthermore, test documentation commonly explains how to run tests (83.5%), but less often provides guidance on how to write tests (37%). It frequently covers unit tests (71%), but rarely addresses integration (20.5%) and end-to-end tests (15.5%). Other key testing aspects are also less frequently discussed: test coverage (25.5%) and mocking (9.5%). We conclude by discussing implications and future research.
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...Egor Kaleynik
This case study explores how we partnered with a mid-sized U.S. healthcare SaaS provider to help them scale from a successful pilot phase to supporting over 10,000 users—while meeting strict HIPAA compliance requirements.
Faced with slow, manual testing cycles, frequent regression bugs, and looming audit risks, their growth was at risk. Their existing QA processes couldn’t keep up with the complexity of real-time biometric data handling, and earlier automation attempts had failed due to unreliable tools and fragmented workflows.
We stepped in to deliver a full QA and DevOps transformation. Our team replaced their fragile legacy tests with Testim’s self-healing automation, integrated Postman and OWASP ZAP into Jenkins pipelines for continuous API and security validation, and leveraged AWS Device Farm for real-device, region-specific compliance testing. Custom deployment scripts gave them control over rollouts without relying on heavy CI/CD infrastructure.
The result? Test cycle times were reduced from 3 days to just 8 hours, regression bugs dropped by 40%, and they passed their first HIPAA audit without issue—unlocking faster contract signings and enabling them to expand confidently. More than just a technical upgrade, this project embedded compliance into every phase of development, proving that SaaS providers in regulated industries can scale fast and stay secure.
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Adobe Illustrator is a powerful, professional-grade vector graphics software used for creating a wide range of designs, including logos, icons, illustrations, and more. Unlike raster graphics (like photos), which are made of pixels, vector graphics in Illustrator are defined by mathematical equations, allowing them to be scaled up or down infinitely without losing quality.
Here's a more detailed explanation:
Key Features and Capabilities:
Vector-Based Design:
Illustrator's foundation is its use of vector graphics, meaning designs are created using paths, lines, shapes, and curves defined mathematically.
Scalability:
This vector-based approach allows for designs to be resized without any loss of resolution or quality, making it suitable for various print and digital applications.
Design Creation:
Illustrator is used for a wide variety of design purposes, including:
Logos and Brand Identity: Creating logos, icons, and other brand assets.
Illustrations: Designing detailed illustrations for books, magazines, web pages, and more.
Marketing Materials: Creating posters, flyers, banners, and other marketing visuals.
Web Design: Designing web graphics, including icons, buttons, and layouts.
Text Handling:
Illustrator offers sophisticated typography tools for manipulating and designing text within your graphics.
Brushes and Effects:
It provides a range of brushes and effects for adding artistic touches and visual styles to your designs.
Integration with Other Adobe Software:
Illustrator integrates seamlessly with other Adobe Creative Cloud apps like Photoshop, InDesign, and Dreamweaver, facilitating a smooth workflow.
Why Use Illustrator?
Professional-Grade Features:
Illustrator offers a comprehensive set of tools and features for professional design work.
Versatility:
It can be used for a wide range of design tasks and applications, making it a versatile tool for designers.
Industry Standard:
Illustrator is a widely used and recognized software in the graphic design industry.
Creative Freedom:
It empowers designers to create detailed, high-quality graphics with a high degree of control and precision.
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Ranjan Baisak
As software complexity grows, traditional static analysis tools struggle to detect vulnerabilities with both precision and context—often triggering high false positive rates and developer fatigue. This article explores how Graph Neural Networks (GNNs), when applied to source code representations like Abstract Syntax Trees (ASTs), Control Flow Graphs (CFGs), and Data Flow Graphs (DFGs), can revolutionize vulnerability detection. We break down how GNNs model code semantics more effectively than flat token sequences, and how techniques like attention mechanisms, hybrid graph construction, and feedback loops significantly reduce false positives. With insights from real-world datasets and recent research, this guide shows how to build more reliable, proactive, and interpretable vulnerability detection systems using GNNs.
Who Watches the Watchmen (SciFiDevCon 2025)Allon Mureinik
Tests, especially unit tests, are the developers’ superheroes. They allow us to mess around with our code and keep us safe.
We often trust them with the safety of our codebase, but how do we know that we should? How do we know that this trust is well-deserved?
Enter mutation testing – by intentionally injecting harmful mutations into our code and seeing if they are caught by the tests, we can evaluate the quality of the safety net they provide. By watching the watchmen, we can make sure our tests really protect us, and we aren’t just green-washing our IDEs to a false sense of security.
Talk from SciFiDevCon 2025
https://www.scifidevcon.com/courses/2025-scifidevcon/contents/680efa43ae4f5
Discover why Wi-Fi 7 is set to transform wireless networking and how Router Architects is leading the way with next-gen router designs built for speed, reliability, and innovation.
1. Origin of Java
• World War-2 need of a platform independent
language
• Green by Sun Micro Systems comes up
• Fails due to marketing issues et al
• Analog-to-Digital Transit, Computer H/W
advancement, Concept of World Wide Web and
Internet, Need of security
• Green transformed to Oak
• 1994 Java makes official release
[email protected]
2. Three Editions of Java
• J2SE (Java 2 Standard Edititon)
• J2EE (Java 2 Enterprise Edition)
• J2ME (Java 2 Micro Edition)
[email protected]
3. Java Data Types
Numeric: 1. Whole Numbers
[email protected]
2. Fractions
Whole Numbers: byte 1 byte default value 0
short2 bytes default value 0
int 4 bytes default value 0
long 8 bytes default value 0
Fractions: float 4 bytes default value 0.0f
double 8 bytes default value 0 .0
Symbolic: char 2 bytes (Sun Unicode Character) default
value‘u0000’
Logical : boolean 1 byte default value false
User Defined: class and interface (to be described later on)
4. Your First Java Program
• In C consider the code snippet…
#include<stdio.h>
void main(){
printf(“Hello From Soham”);
[email protected]
}•
The corresponding Java Code would be…
class A
{
public static void main(String[] args){
System.out.print(“Hello from Soham”);
}}
5. Before I say more on Java some Do’s
Soham was writing a program as on LHS. After typing out 1000 lines he
felt he needed an extra statement in if branch, but poor Soham! What he
did was
[email protected]
• if(condition)
statement-1;
statement-2;
.
.
.
Statement-1000;
• if(condition)
statement-1;
ssttaatteemmeenntt--11AA;;
statement-2;
.
.
.
Statement-1000
6. Poor Me! I intended something else
I was supposed to type…
• if(condition){
[email protected]
statement-1;
ssttaatteemmeenntt--11AA;;
}}
statement-2;
.
.
.
statement-1000
• Moral:
1. When you come across some
if-else branch, or for, while,
switch, or any method or
block, at once type out the
braces and then carry on with
your code
2. It’ll not only save you from
my condition, but also it’ll
save you quite a lot of time of
compilation errors saying…
“ } required”
7. More on Java
Answers to some FAQ about Java 2
• A java file is saved in .java extension
• A java file, if successfully compiled, produces x+y number of .class
files where x and y are the number of classes and interfaces in that
file
• In java, you can’t put anything except comments outside a class or
[email protected]
interface block
• To run java program you need Java Virtual Machine(JVM) which
comes as a part of JDK.
• Successful compilation generates .class files which contain byte
codes that is interpreted by JVM. So, java development generally
uses both compiler and interpreter.
• Java Byte codes are platform independent but JVM is different for
different Operating Systems.
8. Features of Java 2 (J2SE 1.4)
1. Platform independent…means runs on any HW+OS environment
2. Java was developed using C++ but excludes the features like
[email protected]
pointers.
3. Java is a purely typed language as it does not allow automatic type
demotion (More on this later on)
4. Java is object oriented, secure due to its various security features,
reusable and portable,form-free and case sensitive and supports
general logical statements like C/C++
5. Java is not only platform friendly but also is very much developer
friendly. As support of this statement, Java does not have concept of
garbage value. It will never let the program perform read operation
on a non initialized local variable .Also, it saves you from getting
tampered data due to overflow and/or underflow since it doesn’t
allow automatic type demotion
9. Java Source File Name & Class Name
1. A java source file may contain any number of classes and interfaces
and there is no such hard-and-first rule that file name and class/
interface name should have relation…. But wait friends, this is
applicable as long as the file contains no public class/interface.
More concisely, a java source file must have the same name as that
of the public class/interface in it. It’s thus implied that a java source
file can contain one and only one public class/interface
2. To compile a Java file, say, A.java you have to give the command
[email protected]
…>javac A.java
3. If successful compilation occurs, you will surely want to run it. And
your command is going to be …> java MyClass where MyClass is
the class inside A.java that has then main method.
4. Remember, MyClass need not always have the main method.
10. My Second Java Program
#include<stdio.h>
void main()
{
int x=940;
printf(“U scored good marksn”);
printf(“Your marks is %d”,x);
[email protected]
}
class A
{
public static void main(String[] ar)
{
int x=940;
System.out.println(“U scored good
marks”);
System.out.print(“Your marks is ”+x);
}
}
11. Printing an output on the console
• We generally use the syntax System.out.print() or System.out.println()
to output text on the console. Difference between them is that println()
can be used with no arguments where as print() can’t be used without
an argument. Also, println() automatically appends a trailing new line
character (‘n’)
• Don’t ask me more about System.out because my plan is to climb up
the Java tree step by step and I don’t want to stumble down the stairs.
Yet, FYI, System is class under java.lang package and out is an static
object belonging to System class and of type java.io.PrintStream.
• Note the syntax: System.out.print(“Your marks is ”+x);
• Here + is concatenation operator instead and apart
from being the traditional addition operator.
[email protected]
12. Dual Nature of + operator
Look at the code snippet below and see the outputs
int x=9; int y=6;
15
System.out.println(x+y);
int x=9; int y=6;
System.out.println(“Sum is ”+x+y);
Sum is 96
int x=9; int y=6;
System.out.println(“Sum is ”+(x+y));
Sum is 15
int x=9; int y=6;
System.out.println(“Product is ”+x*y);
Product is 54
int x=9; int y=6;
System.out.println(x+y+ “ is the sum”);
15 is the sum
int x=9; int y=6;
System.out.println(x-y+ “ is difference”);
3 is difference
int x=9; int y=6;
System.out.println(“Difference is”+x-y);
Compilation error:
Operator – cannot be applied to
java.lang.String,int
[email protected]
13. From the Experts’ Desk
1. Since you can’t always afford to remember all the precedence rules and
this sort of things, the Java Guru recommends that you should always
use parentheses while using arithmetic expressions in the simplest way
2. As you are mostly accustomed to C/C++, first you’ll ask for a
counterpart of scanf() and cin>>. Yes. You can take input from console
through keyboard. But as I’ve told you, wait till I make you climb to
that level! Java, unlike C/C++ is not meant to be used as a mere
programming language with console as you did with Turbo C++,
generating Pascal triangles or Fibonacci Series et al.
3. Today java is more of a technology than of a language itself. Java can
carry out robust networking, enterprise web development to small
mobile device programming.
4. Note that Java handles all inputs as String, unlike C then tries to
convert to the intended type.
[email protected]
14. Java As a Typed language: code snippet
[email protected]
byte x=9;
System.out.println(x);
Here output will be 9 It’s OK to assign a value to
a type within range
byte x=129;
System.out.println(x);
Error: Possible loss of
precision: found int ,
required byte
Value beyond range. Range
of byte –128 to +127
byte x=(byte)129;
System.out.println(x);
Output: -127 (data
tampered due to overflow)
Explicit type casting may
cost you to worry later
int y=5; byte x=y;
System.out.println(x);
Error: Possible loss of
precision: found int ,
required byte
Though value is in range,
type int can’t be
automatically demoted.
int y=5; byte x=(byte)y;
System.out.println(x);
OK. Output: 5 Explicit type demotion ok
here but can cause OF/UF
long y=8; int x=y;
System.out.println(x);
Guess yourself Automatica type demotion
not allowed so error.
float x=9.8; // Error
Should be float x=9.8f;
Error: possible loss of
precision: found double
required float
9.8 is double and 9.8f/9.8F
is float. This is because java
is memory efficient
15. Java A Typed Language: Contd.
1. boolean is the only data type that can’t be converted to
any type nor any other type be converted to boolean.
2. Implicit type demotion is not allowed in java. You have
to do it explicitly. But before that make sure that it
causes no overflow and/or underflow or both.
3. Although char is 2 bytes and so is short, yet they are not
compatible. char is automatically converted to int or
higher. For hierarchy consult any standard book.
4. char is unsigned strictly in java and note the following.
char ch=-90; // Error
char ch=90; System.out.println(ch); // output : Z
char ch=90; System.out.println((int)ch);// output 90
[email protected]
16. Operators: Unary & Binary
1. Rule for Unary Operator:
“If the operand is of a type which is below int in the hierarchy, the
output is converted to int, else the type of the output is the type of
the operand.”
2. Rule for Binary Operator:
“ If the Binary operator takes 2 operators one of type T1 and the
other of type T2, and max(T1,T2) is less than or equal to int, the
output is converted to int itself, else the output is of type
max(T1,T2)”
This rule is not applicable to increment and decrement operators
Hold your breath dears! Lots of surprises await you in the next
slide.
[email protected]
17. Look at the code snippets below
[email protected]
byte x=9; x=-x;
System.out.println(x);
Error: Possible loss of
precision found: int
required: byte
Rule-1: inputbyte
Output int
byte x=9; byte y=x+1;
System.out.println(x);
Same Error Rule:2 i/p byte, int
O/p int
byte x=7; byte y=2;
short z=x+y;
Same Error! Apply Rule-2
long x=89; byte y=8;
int z=x+y;
Error! Apply Rule-2. Output is
of type long
byte x=9; x=x+8; Error Apply Rule-2: Output is
of type int
byte x=9; x+=8; x++; OK Rule-2 Not applicable
for += and ++ operator
char ch=‘%’; int x=100
System.out.println(x+ch
+ “ pure am I”);
Output 137 pure am I Be careful. To avoid
this, use parentheses or
String ch=“%”;
18. Note the Following
• byte x=‘c’; // is OK
• int x=12;
byte y=x; // Error
• final int x=12; byte y=x; // IS OK
• final int x=134; byte y=x; // Error out of range
• This holds only when source data is less than or
equal to int.
• Adding the keyword “final” before a variable
makes it constant. It can’t be changed and any
code to change this will result in compilation error
[email protected]
19. Note the following code snippets
public static void main(String[] args){
int x;
x++;
System.out.println(x);
}
Error: variable
x might not
have been
initialized.
In Java there is no concept
of garbage value. Without
initializing a local variable
u can’t perform read
operation on it.
[email protected]
int x;
if(6>4){x=8; }
System.out.println(x);
OK. Output will
be 8
6>4 is evaluated at compile
time. So, since it’s true
always, x must be
initialized.
int x;
if(6<4){ x=8;}
System.out.println(x);
Error:variable
x might not
have been
initialized.
6<4 is evaluated at compile
time. So, since it’s false
always, x must not be
initialized.
Replace numerics by variables say, a &
b. Observe the result, it’s error
if(a>b){ x=8;} System.out.print(x);
But making them final will be ok if a>b
is true
Error:variable
x might not
have been
initialized.
a>b or a<b is not evaluated
during compilation time.
So, it’s not sure if x is
initialized or not. Hence
Error