 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use sequence input stream in Java. Before starting, you can subscribe my YouTube channel by clicking on the link which is available at bottom right corner of this video. You can download my app Takimas that is available on Google clay. You can connect with me by following these details which are available in front of you. Now coming onto the topic. In this demonstration, I will be explaining the use of sequence input stream class. So I have imported Java.io package. I have used asterisk sign. So it will import all the necessary classes which are available in this package. If you want to specify specific classes, then you can remove this statement and you can press control plus shift plus O. This is a feature of Eclipse software that I am using. So if you press control plus shift plus O, then required classes will be automatically imported. So either you can use Java dot IO dot asterisk for importing all the classes or you can type control plus shift plus O so that all necessary classes will be imported automatically. So here four classes are imported. Then user defined class name is sequence demo which is containing main method. Inside main method various statements are written and you can see main is throwing an exception IO exception. Here through clauses available. It means if any exception is available in main method main will not be handling or catching that exception. It will be handled by the JVM because main is called by JVM Java virtual machine. So that's why throws clause is available here. Then file input stream FIS one object is created which is linked with file one dot txt. It will open this file in read mode. Then FIS two object is created which is linked with file two dot txt. It is opening file in read mode for these two objects. These two files must be available in the system. Then sequence input stream SIS object is created which is receiving two arguments FIS one and FIS two. So sequence input streams object combines more than one files together so that you can read input from those files in a single loop. If you want to read multiple files then you have to process more than one loops. But if you want to place a single group to read more than one files then you can apply a sequence input stream class for that purpose. So here FIS one and FIS two both are linked with sequence input stream object SIS. So instead of FIS one and FIS two you can simply use SIS object. Then I want to store output of file one and file two into file three. So file output stream object FIS is created which is linked with file three dot txt. If this file is not available it will be created automatically. And this is opening file three dot txt in write mode. It means if it is available and it is containing some text that text will be automatically removed. Then int ch ch variable is declared which is of integer type. Then a loop is available which is reading contained with the help of read method. Here SIS dot read is used. So a single contained or single value will be read inside ch variable. Then that value will be type converted or type casted into character. And then with the help of write method it is written inside FOS. So SIS is sequence input stream object which is linked with FIS one or FIS two. So first it will read the data of file one dot txt. Those data will be stored inside FOS which is linked with file three dot txt. Then after completion of file one, file two will be read automatically with the help of this SIS dot read. So sequence input stream automatically reads values of multiple files which are linked with its object. Minus one is representing endo file. So whenever endo file is available this loop will be terminated and control will be transferred to these statements. These statements are closing all the objects which I have created SIS, FIS one, FIS two and FOS. So they are closed. So this is the explanation of the program. Now we have to check whether these two files file one and file two are available or not. So I have created this dorjava file in sanjay project and this project of Eclipse is stored in a particular path which is D, then practice folder. Inside practice folder you can see sanjay project is available. Inside this project file one and file two dot txt are available. File one is containing sanjay and file two is containing gupta. Now I want to combine content of these two files into third file using sequence input stream. So now I am going to execute this code. So I am clicking on this button which is for execution. It will not show any output on console because I have not used system.out.println but it will create third file that is file.txt. You can see it is created here. Now I am opening this file. You can see sanjay gupta both the contents which are available in file one and file two are available in file three with the help of sequence input stream. So if you want to concatenate contents of more than one files or you want to process contents of more than one files then you can then you can link those files with sequence input stream object and then you can process all the files in a single rotation. So I hope you have understood this concept of sequence input stream. If you want to watch more programming related videos you can subscribe my youtube channel. Thank you for watching this video.