9.3 User Input using System.in.read() method in java

  Рет қаралды 122,731

Telusko

Telusko

Күн бұрын

Пікірлер: 36
@sairajdas6692
@sairajdas6692 6 жыл бұрын
Sir since you did char type casting, it didn't print out the ascii value of Enter . Thank you sir btw for the video !
@praveshmandloi9131
@praveshmandloi9131 8 жыл бұрын
hii sir thats nice way in that you have to write print except println.. then it wil run in right manner.. int i=System.in.read(); System.out.println("You have enter:"+(char) i); String str="";
@MrYrpr
@MrYrpr 7 жыл бұрын
I like your videos a lot Once I get a job, I will take paid course from you just as a way of saying thank you
@adithyak7233
@adithyak7233 8 жыл бұрын
Hi Navin,your teaching is really good, thanks a lot
@aarushigupta1106
@aarushigupta1106 9 жыл бұрын
sir yr contribution is anonymous .... thanku so much for clearing our doubts ... this really means a lots and lots of thanks a students trophy for a teacher infact the best teacher of java
@SmartProgramming
@SmartProgramming 6 жыл бұрын
helpful video sir, thanks for this explanation 👍👍
@CindyXin520
@CindyXin520 7 жыл бұрын
thanks for the tutorial, helpful as always. comment out the initial value of int i and the code works: int i; // comment out initial value "int i = System.in.read();" String str = ""; while((i=System.in.read())!=10){ str = str + (char)i; } System.out.println(str);
@mohanrammanikandan7939
@mohanrammanikandan7939 5 жыл бұрын
Hi, Cindy. Can you please explain how this loop works and the output arrives at "avin Reddy" finally ?
@BoogieBash
@BoogieBash 4 жыл бұрын
code inside of main: int i=32; String s1=""; while(i!=13){ i=System.in.read(); s1=s1+(char)i; } System.out.println(s1);
@deepakpatra2011
@deepakpatra2011 4 жыл бұрын
It also works with 10 instead of 13.
@akarim3643
@akarim3643 8 жыл бұрын
Your lecture is really very helpful...Thanks a lot keep it up !!
@rohitsoni9325
@rohitsoni9325 8 жыл бұрын
Correct code for taking the input till user presses space key is::: System.out.println("Enter: "); String Str = ""; int i = System.in.read(); while((char)i != ' ') { Str= Str + (char)i; i = System.in.read(); } System.out.println("String is :"+Str);
@mehrosenasir3966
@mehrosenasir3966 5 жыл бұрын
The object "out" of printstream class in not created in System class , it is placed in System class only .
@nicholascousar4306
@nicholascousar4306 4 жыл бұрын
Is that what is meant by "out" being listed as a field, rather than a subclass of the System class?
@valdemirmaximo5064
@valdemirmaximo5064 3 жыл бұрын
Hi, I'm trying to use this method in Netbeans, but I can't find the place to enter the character and type enter. In the output it doesn't work. Do you have any idea?
@VC.Vishal
@VC.Vishal 6 жыл бұрын
ASCII code for Enter is 13. while(i!=13) { i=System.in.read(); str = str + (char)i; }
@vishnukiran3847
@vishnukiran3847 6 жыл бұрын
ASCII code for Enter key is 10. 13 is for Carriage return key.
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
@@vishnukiran3847 That is what happens when you enter
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
but nevermind, both works equally
@nilaythakkar
@nilaythakkar 7 жыл бұрын
Really Helpful.Thank You so much
@bilehchoudhury3432
@bilehchoudhury3432 4 жыл бұрын
Why is this program not wait for String input import java.util.*; class Input{ public static void main(String args[]) { Scanner s=new Scanner(System.in); System.out.println("Enter Age"); int x=s.nextInt(); System.out.println("Enter Your name "); String name=s.nextLine(); System.out.println("Name is : "+name+"Age is :"+x); } }
@manujkumarjoshi9342
@manujkumarjoshi9342 4 жыл бұрын
since you are having some code upward, your Navin reddy code is conflicting with that. Else it is working fine.
@kirangadhave8152
@kirangadhave8152 9 жыл бұрын
ASCII value for Enter is 10 i think. It didnt display the ASCII value for ENTER because you typecast i as char in sout statement. I think! Awesome tutorial series btw!
@souvikpal6262
@souvikpal6262 7 жыл бұрын
9.4 is missing .. Please post the link in playlist.
@the_laptopgamer7167
@the_laptopgamer7167 7 жыл бұрын
kzbin.info/www/bejne/oGXUqH6VbZqefbc found this on youtube .. and I believe this one is the missing part of bufferedreader ... But I have no idea how someone else is uploading it on youtube while the owner of this video is missing it from his playlist
@souvikpal6262
@souvikpal6262 7 жыл бұрын
Omg ! Yes .
@alokdubey4771
@alokdubey4771 6 жыл бұрын
Sir we can write this also na While(system.in.read()!='\0') Sir please try this also I don't have a system in my house that's why I'm telling you
@dr.nishachaudhary5895
@dr.nishachaudhary5895 4 жыл бұрын
yes we can. but you cannot.....as you dont have a system, so first take a system, then right the code you suggested.... it will work ....ha ha ha
@aarushigupta1106
@aarushigupta1106 9 жыл бұрын
sir commenting for marker interface is disabled so my question is on marker interface can u quote an example for its use if we know that we have implemented P then why we need to check
@LogicalManSujeet
@LogicalManSujeet 6 жыл бұрын
what is your paid course
@xyber_punk
@xyber_punk 5 жыл бұрын
public class UserInput { public static void main(String[] args) throws Exception { int i=System.in.read(); System.out.print((char)i); String str=""; while((i=System.in.read())!=10) str=str+(char)i; System.out.println(str); } }
@mohammedviso2269
@mohammedviso2269 7 жыл бұрын
Nice
@WorldWorrier3273
@WorldWorrier3273 4 жыл бұрын
I think you are also a beginner in Java.
@mitashasrivastava9605
@mitashasrivastava9605 7 жыл бұрын
when I am taking an string input using this method Dan it is going to infinite loop.can uh plss help?
@vandachhoeung1976
@vandachhoeung1976 6 жыл бұрын
I like it
@WorldWorrier3273
@WorldWorrier3273 4 жыл бұрын
I think you aren't comfortable with Java , and you shows a lots of add too which is really makes us unhappy ☹️
User Input using BufferedReader
4:53
Telusko
Рет қаралды 181 М.
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 10 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 349 М.
9.2 What is toString method in Java Example
7:09
Telusko
Рет қаралды 248 М.
#95 Comparator vs Comparable in Java
15:43
Telusko
Рет қаралды 193 М.
#83 User Input using BufferedReader and Scanner in Java
11:48
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 940 М.
Java Getting User Input | Java Course in Tamil | Logic First Tamil
12:26
Logic First Tamil
Рет қаралды 107 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 756 М.
How to accept user input in Java ⌨️【8 minutes】
8:02
Bro Code
Рет қаралды 207 М.
#86 Multiple Threads in Java
11:30
Telusko
Рет қаралды 131 М.
Map and HashMap in Java - Full Tutorial
10:10
Coding with John
Рет қаралды 587 М.
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 10 МЛН