0% found this document useful (0 votes)
33 views1 page

Java Programs: A-Z Display & File Copy

Uploaded by

kotkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Java Programs: A-Z Display & File Copy

Uploaded by

kotkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

java slip1

Slip 1 A) Write a ‘java’ program to display characters from ‘A’ to ‘Z’.

Answer :
class slip1A{
public static void main(String args[]){
for(int i=65; i<=90; i++){
[Link]( " " + Character. toString((char) i));
}
}
}

Slip 1 B) Write a ‘java’ program to copy only non-numeric data from one file to another
file.

Answer :
import [Link].*;
class Slip1B{
public static void main(String args[]) throws IOException{
char ch;
FileReader fr = new FileReader("[Link]");
FileWriter fw = new FileWriter("[Link]");
int c;
while ((c=[Link]())!=-1){
ch=(char)c;
if([Link](ch)==false){
[Link](c);
}
}
[Link]();
[Link]();
}
}
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

You might also like