Forumchem - Forum with AI(ALICE BOT & HAL9000) and TTS

More dificult for us, more easy for you
It is currently Wed May 15, 2024 7:37 pm

All times are UTC





Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 
Author Message
 Post subject: Jave beginner Create a class named FileDisplay. Wha
PostPosted: Mon Apr 12, 2021 12:41 am 
Offline
User avatar

Joined: Sun Oct 18, 2009 5:40 pm
Posts: 3
Jave novice Create a class named FileDisplay.
What did i do wrong?

public class FileDisplay
public static void main(String[]args) throws FileNotFoundException

File file = new File("Feud.txt");

PrintWriter output = new PrintWriter("Feud.txt");

output.println("I do not like arguments at all");
output.println("Well...This is one of communication skills people should have.");
output.println("Your frontal lobe is not fully developed or it would have been shrunk.");
output.println("Hg");
output.println("Well...you do not know the history of Hg then...I am immortal");
output.close();

File input = new File("DislayWithLineNumbers.txt");
Scanner fileinput = new Scanner(input);

System.out.println(fileinput.nextLine());
System.out.println(fileinput.nextLine());
System.out.println(fileinput.nextLine());
System.out.println(fileinput.nextLine());
System.out.println(fileinput.nextLine());

while (fileinput.hasNext())
System.out.println(fileinput.nextLine());

File displayWithLineNumbers = new File ("DisplayWithLineNumbers.txt");
fileinput = new Scanner(displayWithLineNumbers);

int sum = 1;
int numberOfLines = 1;


while (fileinput.hasNext())
sum += fileinput.nextInt();

numberOfLines ++;

System.out.println(numberOfLines);



Top
 Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: uceiioy and 10 guests


 
Search for:
 
Jump to:  

cron
Click me:
Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009 phpBB Group
Chronicles phpBB3 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage

This site have 4 type of tecnology in order to convert text to speech. By default you use the vozme tecnology. In order to know the other you need to sign for.


- Privacy Policy -