Wednesday, May 2, 2018

Read and print method


Read() readLine()  মেথড  কি বোর্ড থেকে ইনপুট নিবার জন্য ব্যবহার করা হয় । আর আউটপুট নিবার জন্য print()  ও println() মেথড অন্যতম ।
চলুন একটা প্রোগ্রাম করা যাক এই দুই মেথড দিয়ে
Frist need class name
This program I use class name cmt
After tthen we can start
Class name cmt
{
    public static void main(String[] args) throws IOException {
        char ch;
        System.out.print("Give some Charter:('Q' to quit)");
        do{
        ch=(char)System.in.read();
        System.out.print(ch);
        }while(ch!='Q');
        System.out.print("Program terminated.")            
    }}

0 comments:

Post a Comment

thank you for your comments