In computer science, a stream is a sequence of data elements made available over time. A stream can be thought of as items on a conveyor belt being processed one at a time rather than in large batches.
Streams are processed differently from batch data :
*Normal functions cannot operate on streams as a whole, as they have potentially unlimited data, and formally
*Streams are codata (potentially unlimited), not data (which is finite).
Object-oriented programming Undergraduate Course Presentations
java.io streams and files in Java
University of Vale do Itajaí
Univali
Incremental Tecnologia
English version
Core Java Programming Language (JSE) : Chapter XI - Console I/O and File I/OWebStackAcademy
Java.io.File Class in Java. The File class is Java's representation of a file or directory path name. ... A file system may implement restrictions to certain operations on the actual file-system object, such as reading, writing, and executing. These restrictions are collectively known as access permissions.
The program uses console I/O to simply read its "standard input (stdin)"—which might be the keyboard, a file dump, or the output of some other program—and print to its "standard output (stdout)"—which might be the display or printer or another program or a file.
https://www.learntek.org/blog/serialization-in-java/
Learntek is global online training provider on Big Data Analytics, Hadoop, Machine Learning, Deep Learning, IOT, AI, Cloud Technology, DEVOPS, Digital Marketing and other IT and Management courses.
Object-oriented programming Undergraduate Course Presentations
java.io streams and files in Java
University of Vale do Itajaí
Univali
Incremental Tecnologia
English version
Core Java Programming Language (JSE) : Chapter XI - Console I/O and File I/OWebStackAcademy
Java.io.File Class in Java. The File class is Java's representation of a file or directory path name. ... A file system may implement restrictions to certain operations on the actual file-system object, such as reading, writing, and executing. These restrictions are collectively known as access permissions.
The program uses console I/O to simply read its "standard input (stdin)"—which might be the keyboard, a file dump, or the output of some other program—and print to its "standard output (stdout)"—which might be the display or printer or another program or a file.
https://www.learntek.org/blog/serialization-in-java/
Learntek is global online training provider on Big Data Analytics, Hadoop, Machine Learning, Deep Learning, IOT, AI, Cloud Technology, DEVOPS, Digital Marketing and other IT and Management courses.
Java I/O (Input and Output) is used to process the feedback and produce the outcome based on the feedback. Java uses the idea of circulation to make I/O function fast. The java.io package contains all the sessions required for feedback and outcome functions.
Java I/O (Input and Output) is used to process the feedback and produce the outcome based on the feedback. Java uses the idea of circulation to make I/O function fast. The java.io package contains all the sessions required for feedback and outcome functions.
Exceptions, I/O and Threads Input and Output in Java: The File Class, Standard Streams, Keyboard
Input, File I/O Using Byte Streams, Character Streams, File I/O Using Character Streams -
Buffered Streams, File I/O Using a Buffered Stream, Keyboard Input Using a Buffered Stream,Writing Text Files. Threads: Threads vs. Processes, Creating Threads by Extending Thread,
Creating Threads by Implementing Runnable, Advantages of Using Threads, Daemon Threads,
Thread States, Thread Problems, Synchronization. Exceptions: Exception Handling, The Exception
Hierarchy, throws statement, throw statement, Developing user defined Exception Classes- The
finally Block.
Creating ESS Jobs for Oracle Fusion BIP ReportsGurpreet singh
Topics:
1. Introduction to ESS Jobs
2. Creating ESS Jobs for Fusion BIP Reports
3. Running the ESS Job
In Oracle Fusion Cloud, an Enterprise Scheduler Service (ESS) job is a scheduled process that automates the execution of various business processes and tasks. ESS jobs enable users to manage, schedule, and monitor the execution of these processes without manual intervention, ensuring that tasks are performed consistently and on time.
Types of ESS Jobs: Predefined & Custom ESS Jobs
This will show all the steps to create Data Model and ESS Job for the BIP Report in Oracle Fusion Cloud
It covers:
Why Messaging System? – Problems without Messaging system
What is a Messaging System?
Types of Messaging Systems
Examples of Messaging Systems
Understanding Flex Fields with Accounting Flexfields(Chart of Accounts) in O...Gurpreet singh
A flexfield is a flexible data field that your organization can customize to your business needs without programming.
A flexfield is a field which is made up of subfields or segments.
A flexfield appears on your form as a popup window that contains a prompt for each segment. Each segment has a name and a set of valid values.
Also covers how to create custom Key Flexfield
***First Half***
Introduction to Oracle Fusion Middleware and Oracle ADF
Getting started with JDeveloper
Building a Business Model with ADF Business Components
Querying and persisting data
Exposing Data
Declaratively Customizing Data Services
Programmatically Customizing Data Services
Validating User Inputs
***Second Half***
Understanding UI Technology
Binding UI Components to Data
Planning the User Interface
Passing values between UI Elements
Responding to Application Events
Implementing Transactional Capabilities
When Web-based business applications communicate with each other, producer applications ENQUEUE messages and consumer applications DEQUEUE messages. Advanced Queuing provides database-integrated message queuing functionality. Advanced Queuing leverages the functions of the Oracle database so that messages can be stored persistently, propagated between queues on different machines and databases, and transmitted using Oracle Net Services, HTTP(S), and SMTP.
An SQL JOIN clause combines columns from one or more tables in a relational database. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining columns from one (self-table) or more tables by using values common to each.
Constraints are the rules enforced on the data columns of a table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Constraints can be divided into following two types:
Column level constraints : limits only column data
Table level constraints : limits whole table data
Aggregate Functions
Generic programming is a style of computer programming in which algorithms are written in terms of types to-be-specified-later that are then instantiated when needed for specific types provided as parameters.
Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow “a type or method to operate on objects of various types while providing compile-time type safety”
The Java collections framework supports generics to specify the type of objects stored in a collection instance.
This contains:
*Getting started with New Dynamic Web Project
*Starting the tomcat server
*Running your project
*Changing the context root
*Changing welcome pages of your website
A business group is the highest level of organization and the largest grouping of employees across which you may report. A Business Group holds a complete, self-contained set of information on work structures, remuneration policies and employees. Each Business Group can have just one particular set of segments defined for its Job, Position, Grade, Employee Group and Cost Allocation key flex fields.
A business group is a basically Human Resources organization to which you assign employees. You assign each operating unit to a business group in the financial options setup. You can assign the same business group to different operating units including to operating units in different financial sets of books. You can setup a separate business group for each operating unit if you want to segregate and maintain each group of employees separately. Oracle provides one setup business group you can use.
Locations are shared across Business Groups in HRMS and with two other Oracle applications: Inventory and Purchasing. HRMS does not use some of the fields in the Location window. These fields are disabled for HRMS users. For example, the Legal Address check box is read-only and supports future functionality in Oracle Financials.
By default, the “Approvals Management Administrator” and “Approvals Management Business Analyst” responsibilities do not have any functions associated with them, because their access is restricted by Role Based Access Control (RBAC).
So we need to assign role AME_BUS_ANALYST to user
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulation. PL/SQL language is rich in built-in operators
What is PL/SQL?
PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7).
PL/SQL (Procedural Language extensions to SQL) is designed specifically for the seamless processing of SQL commands. PL/SQL stored and compiled in the database, runs within the Oracle executable and inherits the robustness, security, and portability of the Oracle Database.
Features of PL/SQL
Syntax of PL/SQL
Using comments
Variable Declaration
Printing messages
Sample Program
A data flow diagram (DFD) is a graphical representation of the "flow" of data through an information system, modeling its process aspects.
Why DFD technique is so Popular?
Symbols used in DFD
Constructing DFD Models
Data Dictionary
Developing the DFD model of System
Level O DFD or Context Diagram
Level 1 DFD
Strengths of DFD Model
Weaknesses of DFD Model
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
2. In computer science, a stream is a sequence of data elements made available over time. A stream can be thought of
as items on a conveyor belt being processed one at a time rather than in large batches.
Streams are processed differently from batch data :
1. Normal functions cannot operate on streams as a whole, as they have potentially unlimited data, and
formally,
2. Streams are codata (potentially unlimited), not data (which is finite).
STREAMS
3. An I/O Stream represents an input source or an output destination. A stream can represent many different kinds of
sources and destinations, including disk files, devices, other programs, and memory arrays.
Streams support many different kinds of data, including simple bytes, primitive data types, localized characters,
and objects. Some streams simply pass on data; others manipulate and transform the data in useful ways.
No matter how they work internally, all streams present the same simple model to programs that use them: A
stream is a sequence of data.
A program uses an input stream to read data from a source, one item at a time
A program uses an output stream to write data to a destination, one item at a time
I/O STREAMS
4. 1. FileInputStream
2. DataInputStream
3. ObjectInputStream
4. SequenceInputStream
1. FileOutputStream
2. DataOutputStream
3. ObjectOutputStream
Programs use byte streams to perform input and output of 8-bit bytes. All byte stream classes are descended
from InputStream and OutputStream.
5. 1. FileReader
2. Buffered Reader
3. LineNumberReader
1. FileWriter
2. PrintWriter
A character stream will read a file character by character.The character streams are capable to read 16-bit characters
(byte streams read 8-bit characters). Character streams are capable to translate implicitly 8-bit data to 16-bit data or
vice versa. Character stream can support all types of character sets ASCII, Unicode, UTF-8, UTF-16 etc.But byte
stream is suitable only forASCII character set.
6. import java.io.*;
class A {
public static void main(String[] args) throws IOException {
FileInputStream fis = null;
int c;
try {
fis = new FileInputStream("D:BCD.txt");
while ((c = fis.read()) != -1) {
System.out.println("Value: " + c + " Character: " + (char) c);
}
}
finally{
if(fis !=null)
fis.close();
}
}
}
FileInputStream
Output:
Value: 65 Character: A
Value: 66 Character: B
Value: 67 Character: C
7. import java.io.*;
class CopyBytes {
public static void main(String[] args) throws IOException {
FileInputStream in = null;
FileOutputStream out = null;
try {
in = new FileInputStream("D:BCD.txt");
out = new FileOutputStream("D:XYZ.txt");
int c;
while ((c = in.read()) != -1) {
out.write(c);
}
} finally {
if (in != null)
in.close();
if (out != null)
out.close();
}
}
}
FileOutputStream
9. Serialization in Java
• Java provides a mechanism, called object serialization where an object can be represented as
a sequence of bytes that includes the object's data as well as information about the object's
type and the types of data stored in the object.
• After a serialized object has been written into a file, it can be read from the file and de-
serialized that is, the type information and bytes that represent the object and its data can
be used to recreate the object in memory.
• Serialization is a mechanism of converting the state of an object into a byte stream. De-
serialization is the reverse process where the byte stream is used to recreate the actual Java
object in memory.This mechanism is used to persist the object.
10. The byte stream created is platform independent. So, the object serialized on one platform can be
deserialized on a different platform
11. A Java object is serializable if its class or any of its super classes implements either
the java.io.Serializable interface or its sub interface, java.io.Externalizable.
Deserialization is the process of converting the serialized form of an object back into a copy of the object.
Serializable is a marker interface (has no data member and method). It is used to “mark” java classes so that
objects of these classes may get certain capability. Other examples of marker interfaces are:- Cloneable and
Remote.
Points to remember
1. If a parent class has implemented Serializable interface then child class doesn’t need to implement it but
vice-versa is not true.
2. Only non-static data members are saved via Serialization process.
3. Static data members and transient data members are not saved via Serialization process.So, if you don’t
want to save value of a non-static data member then make it transient.
4. Constructor of object is never called when an object is deserialized.
12. public class Employee implements java.io.Serializable
{
public String name;
public String address;
public transient int SSN;
public int number;
public void mailCheck()
{
System.out.println("Mailing a check to " + name + " " + address);
}
}
13. import java.io.*;
public class SerializeDemo {
public static void main(String [] args) {
Employee e = new Employee();
e.name = "Reyan Ali";
e.address = "Phokka Kuan,Ambehta Peer";
e.SSN = 11122333;
e.number = 101;
try {
FileOutputStream fileOut = new FileOutputStream("/tmp/employee.ser");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(e);
out.close();
fileOut.close();
System.out.printf("Serialized data is saved in /tmp/employee.ser");
}catch(IOException i) {
i.printStackTrace();
}
}
}
Serialization in Java
14. import java.io.*;
public class DeserializeDemo {
public static void main(String [] args) {
Employee e = null;
try {
FileInputStream fileIn = new FileInputStream("/tmp/employee.ser");
ObjectInputStream in = new ObjectInputStream(fileIn);
e = (Employee) in.readObject();
in.close();
fileIn.close();
}catch(IOException i) {
i.printStackTrace();
return;
}catch(ClassNotFoundException c) {
System.out.println("Employee class not found");
c.printStackTrace();
return;
}
System.out.println("Deserialized Employee...");
System.out.println("Name: " + e.name);
System.out.println("Address: " + e.address);
System.out.println("SSN: " + e.SSN);
System.out.println("Number: " + e.number);
}
}
De-Serialization in Java
Output
Deserialized Employee...
Name: Reyan Ali
Address:Phokka Kuan, Ambehta Peer
SSN: 0
Number:101
15. Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper
classes.
For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.
Here is the simplest example of autoboxing:
Character ch = 'a';
The automatic conversion of wrapper class type into corresponding primitive type, is known as Unboxing. Let's see the example of unboxing:
Integer i=new Integer(50);
int a=i;
Boxing and Un-Boxing in Java
16. //Used For Reading from multiple streams
FileInputStream input1 = new FileInputStream("D:A.txt");
FileInputStream input2 = new FileInputStream("D:B.txt");
SequenceInputStream inst = new SequenceInputStream(input1, input2);
int j;
while ((j = inst.read()) != -1) {
System.out.print((char) j);
}
inst.close();
input1.close();
input2.close();
SequenceInputStream
Output:
ABCXYZ
17. FileReader
import java.io.*;
class A {
public static void main(String[] args) throws IOException {
FileReader fr=new FileReader("D:A.txt");
int r;
while((r=fr.read())!=-1)
System.out.print((char)r);
fr.close();
}
}
Output:
ABC
18. BufferedReader
import java.io.*;
class A {
public static void main(String[] args) throws IOException {
FileReader fr=new FileReader("D:A.txt");
BufferedReader br= new BufferedReader(fw);
String s;
while ((s =br.readLine() !=null){
System.out.println(s);
}
fr.close();
br.close();
}
}
19. FileWriter
import java.io.*;
class A {
public static void main(String[] args) throws IOException {
FileWriter fw=new FileWriter("D:A.txt");
int r=65; //Character "A"
fw.write(r);
fw.close();
}
}
20. PrintWriter
import java.io.*;
class A {
public static void main(String[] args) throws IOException {
FileWriter fw=new FileWriter("D:A.txt");
PrintWriter pw=new PrintWriter(fw);
pw.println(“Hello”);
pw.close();
fw.close();
}
}
21. LineNumberReader
import java.io.*;
class A {
public static void main(String[] args) throws IOException {
LineNumberReader lnr=new LineNumberReader(new
FileReader("D:A.txt"));
System.out.println(lnr.getLineNumber());
System.out.println(lnr.readLine());
System.out.println(lnr.getLineNumber());
lnr.close();
}
Output:
0
Line1
1