Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †
Elite Coders Society
Hello Guest!
Join us here in this forum!
Please Log in or Register to access more feature in this site.
Start Learning!

† Copyright ©️ 2011 - EliteCoders.forums.ag †


Start sharing and learning new skills about programming and design by building connections with other professional and students.
 
HomeForumBufferedReader Syntax 2a512xyPortalLatest imagesGalleryBufferedReader Syntax Dw6hztSearchBufferedReader Syntax 2ns506pBufferedReader Syntax 2dt2b75RegisterLog in
Elite Coders Partner Links

EliteCoders™️ News!
Hello Guest!, Welcome in our forum. Be active!

Share | 
 

 BufferedReader Syntax

View previous topic View next topic Go down 
AuthorMessage
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 28
Location : Philippines

Hacker's Info
Hacking Exp:
BufferedReader Syntax Left_bar_bleue0/0BufferedReader Syntax Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

BufferedReader Syntax Empty
PostSubject: BufferedReader Syntax   BufferedReader Syntax EmptyFri Nov 18, 2011 4:02 pm

BufferedReader Syntax.

The program starts with the code import java.io.*; before the class name, but must be inside the method


Code:

1 import java.io.*;
2 class progName {
3      public static void main(String[] args){
4      BufferedReader brVarName = new BufferedReader(new InputStreamReader(System.in))throws Exception;
5    }
6 }

Note: The numbers in the left side represents the line number.
Back to top Go down
Admin[dElmARk]
Admin[dElmARk]
Forum Owner
Forum Owner

Posts : 78
EC-Points : 6304
Thanked : 21
Join date : 15/10/2011
Age : 28
Location : Philippines

Hacker's Info
Hacking Exp:
BufferedReader Syntax Left_bar_bleue0/0BufferedReader Syntax Empty_bar_bleue  (0/0)
Hacker Type: White Hat
Hacking Title:

BufferedReader Syntax Empty
PostSubject: Re: BufferedReader Syntax   BufferedReader Syntax EmptyFri Nov 18, 2011 5:01 pm

Declaring variable together with its data type using BufferedReader.
(Continued..)

Via Input Data
Code:
String stringVar = brVarName.readLine();
char charVar = brVarName.readLine();
int intVar = Integer.parseInt(brVarName.readLine());
Double doubleVar = Double.parseDouble(brVarName.readLine());
Fload floatVar = Float.parseFloat(brVarName.readLine());

User Defined Declaration
Code:

String stringVar = "Text Message, Sencence or Paragraph";
char charVar = 'a'; || Char charVar = '1';
int intVar = 12;
Double doubleVar = 100.0;
Fload floatVar = 50.0;


__________

Take a look at this:

Code:

import java.io.*;
class Sample{
    public static void main(String []args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Input Name: ");
    String name = br.readLine();
    System.out.print("Input a letter or a number: ");
    char character = br.readLine();
    System.out.print("Input your age: ");
    int age = Integer.parseInt(br.readLine());
    System.out.print("Input a number with decimal: ");
    Double Doubledecimal = Double.parseDouble(br.readLine());
    System.out.print("Input a number with decimal: ");
    Fload Floatdecimal = Float.parseFloat(br.readLine());
    }
}

Back to top Go down
 

BufferedReader Syntax

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Elite Coders Society :: Software Development :: Java Programming :: Java Programming-

Protected by Copyscape Duplicate Content Finder
Powered By EliteCoders™

Elite Coders Partner Links
GreyPhantomYour Link HereYour Link HereYour Link Here
Yahoo!GoogleFacebookForumotion