So, we have learned about a very basic things about the Java in the last two lectures. Now, we will see exactly what are the tools and resources that you should have in your own custody, so that you can develop your own program, run your own program, test your own program and all these things. So, today's lecture includes what are the tools and resources that you can think, so that you can use in and then you can prepare your programming environment.
So, Java programming tools first I would like to discuss about it. Now, one very interesting thing about is that everything is free. That means, Java tools those are freely available you can download it from the net and then you can use it.
So, what the thing it is required is that you should have your own machine a laptop whether it is Windows, it is Mac OS or it is Solaris absolutely it is not an issue you just have it. And, then you can download the program from the different links. So, I will tell you the different links that is available and then you can use it.
So, basically the JDK once I told you the JDK is called the Java Development Kit, this is the basic building what is called the blocks or basic building tools. Basically, we can load it and once you load it you can install it. So, JDK can be load directly from the Java source, Java soft you just simply in the Google give you the index JDK and then you can find lot of links and there are free links all does that mean they are freely downloadable.
And so far the JDK is concerned there are many versions one is called the SDK version and JDK version. I should not suggest you to download the SDK. SDK is for the advanced programmer, it is called the super development kit.
There are many features unnecessarily make your system slow. So, better not to use it and so far the JDK is concerned which was introduced in 1996 first time after that lot of versions are available till time the latest version that you can have 11. But for beginners the basic programmers right. You should use the JDK version 8. JDK version 8 is most versatile, most mature and then it is easy to use. So, I should suggest you to download the JDK version 8 in your machine and then install the same in your machine.
So, this will completes the Java software for your working that is all. Now next, let us see what are the things there. in your JDK tool.
JDK is a basically a bundle that means, it contains many programs. Now, here I have listed the programs those are there in JDK. I can say the JDK or SDK the both the things are same.
So, there are in fact, 7 programs. I have already discussed about one program that means, to how to translate a dot java file into dot class file it is called the javac. So, javac is there it is basically java compiler.
Then, Java one another command we have used to run the program it is called the Java interpreter. So, this is these are the two programs very used frequently used in that is there in bundle in JDK. Other than this for some large program software development where we have to have a documentation that means, different documentation for large software is required and there is a tools available for that is called the Java doc. In Java doc you can do very quiet. And, comfortable documentation in your own program so that the program written by you can understand by any other programmer who can who wants to extend your program all these things.
So, in a team work if you want to do develop a program, java doc definitely suitable and you should know it. Then, applet viewer is very another program and applet viewer is basically to run the java applet regarding java applet we will discuss about it is just like a browser program. So, it basically run HTML file actually which contains some Java code in it. So, Applet viewer is to basically running Java Applet a special kind of Java program which is basically suitable for window programming or is a graphical user interface program development. Then the Java debugger, so if you have very large set of classes in your program sometimes it is not giving the desired output.
Then you may have to debug that means, find the error where it is there. So, for this debugging the JDK provides you a very efficient and then handy tool set it is called the JDK. This is for the Java debugger for fixing errors in the program.
And then Java dissembler it is called the Java AP that is basically dissembling if you want to make the program if it is very easy. complex and large program into several components. So, Java AP will basically allow you to dissembling your program into small program sets and then it is also a tool that you can use it and then do it. And then Java H is the one another facilities included in JDK and it basically help us to create an interface between Java. And, other programming particularly C routines or C++ routine here basically java is used suppose some part of the program you want to develop in C and then another program part you want to develop in java and then both the things are needs to be interface together.
So, that they can work together. So, in that case you can use java H is a facilities that is bundle there in JDK. There are few more resources.
that you should consult while you learn this programming and also attend this course. And one is the very important link it is called the very popularly it is called Java T point is a tutorial point. So, it has very large set of examples and then illustrations and then only the missing is that they do not discuss about the theory or any concept.
They have just simply A sea of programs we can say that you can download from this, run in your environment and by the way you can learn a lot of course, but without knowing theory and then principle and concept learning on the program is not suitable. So, this is not so suitable for the beginners of course, but you can at least have some hands on of some programming from the source. So, it is the Java T point and Java another few I mean documentation.
that you can download from the Java SunJava website itself. So, there are many documents documents and very vast document of course, sometimes if you are to learn this program in a small I mean say maybe in 3 months or 2 months, then learning all those things is really not suitable. And this documentation is of course, good and is preferable for the advanced programmer.
So, if you are not an advanced programmer, then all these program should not be utilized at the moment. Later on whenever you learn some basic things, then you can use it as a run as a more advanced step. And there are few more resources that is also available which you can consult that is again from the Sanjava website itself.
This is a very author authenticated document actually there is no error in the documentation. So, the error free documentation and then very professionally. maintain the documentation.
This is from the java.sun.com is from the sun original websites. And there is another Sun developer network is also available for many other resources. This is also from the Sun microsystems official website, where the documentation regarding many packages actually java also the JDK includes many other packages those packages are called API. Now, regarding these packages, this package is basically library.
So, if you want to know about these libraries and what are the classes are there in the libraries and what are the functions or methods or operation that all classes will do for you then the API documentation, those API documentation also you can have it from java.sun.com website. So, these are the very two important links that you can have it. Now, I was talking about in API and is a full form is application programming interface.
Now, Java is great because of this the APIs. The Java API is basically is a very big one voluminous resources and in fact, there are I mean 9 packages and each packages consist of huge number of classes and their definitions and then they are used. So, all these classes You can use in your program that means, is basically programmer supports.
So, there are 9 packages are there and then all packages are basically categorized. to serve a different task. Now, for example, there is one package called applet. So, this package is usually called java.applet.
So, this package is basically suitable for writing applet in writing applet and programming in applets. So, applet as I already told you applet is for designing graphical user interface. Graphical user interface means the button, Then checkbox, scroll window, then text field area all these things.
So, these basically the applet packages will help you to create the graphical user interface very easily without knowing details about how they are doing. It is just like a magic if you know that this is the one class that you should use to create your own button and then use it and then run it like this one. Now so, Java applet is the one right is for applet programming. And, regarding Applet programming, Applet programming is a very fast concept of course, and we will learn shortly. And then there is another package, the name of the package is called java.awt, it is called the Java Abstract Windowing Toolkit.
So, abstract windowing toolkit is basically another extension or is a basically support to develop GUI programs. Then another Package regarding input output handling, you can recall the different way the input can be considered input from the mouse, input from the microphone, input from the document, input from the handwritten gesture whatever it is there. So, input from an image, input from network.
So, how to deal with so many versions of input? So, there is a package dot io package java dot io which basically help you to. Take the input from many sources and then use in your program process it and then produce output according to the requirement. So, java.ie is basically suitable. java.lang is another package which is basically frequently used package.
That means, one program which always required one package that is the java.lang package. You cannot write any program without java.lang package. Whereas this package.
is very important and essential and in all program it is required. So, it is not required to be explicitly imported that means, it will automatically included in your program if you even if you do not import. However, other packages if you want to use it then before using they should be imported in your program. I will tell you how to import a package in your program or a particular class which belongs to a particular package in your program.
So, there is a concept that means, a particular facilities that can be imported in your program, whereas java.lang is a default package that can be imported automatically and it basically give you the basic programming facilities that you can have if you have this java.lang package. So, out of 9 packages we have discussed 5, there are few more important packages are there few more packages like java.net, net is basically the package suitable for network programming. Networking is a very important one features in Java programming. So, we can have the java.net packet to develop our network protocol, network programming, socket programming like this.
And java.util it is basically one advanced one programming which basically gives you many what is called the built in data structure. As you know data structure is a very important concept for. Programming that means, you have to store the data in an efficient way. How you can store the data in an efficient way?
Data structure tells about it. The many data structure like stack, queue, linked list, vector all these things are readily defined in the package java.util. One important dictionary data structure is called dictionary that means, you can maintain a dictionary for any language to any language or dictionary for medical vocabulary.
or whatever it is there. So, the dictionary data structure is already there data structure means how to define the structure and then what are the operation already defined in that package. So, you just know about that what are the facilities available and then you can plug in your program and then use it. Then the one advanced packages those are there in java later on it is included early in earlier version it was not java version 5 onwards. This package is used it is called the swing.
Swing is just like AWT, but it is more interesting and more large. Lovely things there in Java programming, Java swing basically another extension of AWT abstract windowing toolkit for supporting GUI development. And for Java database connectivity there is one package it is called the java.sql. So, this using this package you will be able to connect to a remote server database from your application.
So, these are the different packages which are available. In Java environment and if you once install JDK with all programs that we have already discussed like JavaHack and Java and Java API, JavaH all these things in addition to this all this API also will be installed automatically. So, in JDK is basically contains everything. Now we told about the free softwares that is available all these softwares are free.
As the Java is very popular and then many software developer, many software engineering firm they develop the program in a large scale to support the program many and sophisticated programming environment is already available in the market. However, it is not free costly. There are few software development environment it is called IDE, the full form is integrated.
Development environment. So, there are lot of IDs are available for example, from SAN microsystem itself one ID is available, but it is not free of cost for the commercial purpose only called the SAN Java workshop. It is very good one environment which can help you to develop your program very easily and in a user friendly manner.
Mojo is the one good I mean popular one software development environment. It is from the Penumbra Software is a company basically suitable for creating Java applets. Similarly, Jumba is from Amtech and IBM, it is also one environment suitable for Java applet programming. And the best I have ever seen is called the Semantic Cafe, it is a very well known, very popular and very sophisticated one programming environment is called the Semantic Cafe. So, if you can afford you can purchase a semantic cafe right and then install in your machine this software include everything your JDK, the API, the other programs and what is not.
So, it will help you a lot debugging, testing, maintaining everything put together is a very nice programming and environment semantic cafe, but it is not free commercially the cost is too much actually individual level it is very difficult to afford. So, do you have that? I should say the third party tools for Java programming environment and there are few tools also available for browsing the softwares. That means, as you know the Java is suitable for internet programming and internet programming means lot of web page programming, JSP, JavaScript or Java browser related programming.
So, there are lot of browsers are also required. However, earlier when Java was introduced initially all. like Internet Explorer, then all these things are supporting.
Nowadays all these browsers stop supporting Java browsing. There are some security issue that is why. So, all browsers cannot support your Java program to browse it directly actually, but the other way it can be browse and it can be executed.
There are many security reason that is why the different browser has stopped running Java program. look remotely actually. And initially HotJava actually was introduced as very beginning when the Java was introduced for the browsing purpose only, but the HotJava is also still available and you can use it, but HotJava is not so popular like Mozilla, Safari or Internet Explorer is popular.
And Netscape Navigator also available as a browser it is a Windows NT environment or some other name. Unix environment Netscore Navigator is available, this also supports Java in a full place. So, these are the browsers that you can think about it, but while you learn Java programming you usually use Applet Viewer as a Java browsing.
So, for learning and practicing the Applet Viewer is fine, but whenever you have to deploy the program the different technology different concept needs to be followed that will be discussed later on, but here till time. We will not discuss about any other browser whenever we have to run Java applets or Java program we will follow applet viewer as a applet browser. And resources available I am not sure whether it is available in a free version or not. There are obviously a free software is available not in the full functionality.
For example, NetBean. NetBean is very famous for building very large software. It is just like an IDE integrated development environment. It is free if it is available obviously not all features cannot be available, but it is at least some essential features you can have it.
So, it is an IDE. So, at least some IDE freely if it is available then it is NetBean you can install and then run your Java program using this NetBeans. And one editor I should mention it which is very good one editor and very sophisticated and versatile editor it is called the Notepad++ because you have to run the program, you have to save the program and those typing the program all those things should be as fast as possible so that efficiently you can do it.
So, Notepad++ is highly recommendable so that you can download it, Notepad++ again is a free software. So, you can download freely and install in your machine and then use as a default editor, you can make the editor as a default this one. Now so, we have learned about the Java language, Java tools and Java resources that you should hold before you just warm up yourself into this Java programming environment and become a Java programmer.
Now, I just want to mention about few things which is basically in Java commonly occur. So, sometimes you have to face all these things again and again. So, these are called the subset of the language, language subset. In fact, a rich subset of the language it is not possible to cover in one slide or in 5 minutes discussion, it require in fact, the full discussion and we will learn all these subsets of the Java language one by one.
So, there are many built in data types like Boolean, Integer, floating all these things. There are many system functions like printl, printf and all these things. For example, in our program we have face the system.out.println this kind of things are there. So, many frequent and then common things are there.
So, this slides includes the many common things those are there in your java programming java programming or while you writing java program you have to use it. Obviously, for the first time programmer all those things little bit looks like very difficult to understand, but once you are practiced it and then involved it. So, you will be slowly habituated all this term. So, these are the subsets and I just want to skip this subset discussion because it will be learned slowly, but consistently we will learn it.
So, these are the basically standard data types if you know C programming then you definitely know that what is the data types like they are called the built in data type or primitive data type like Boolean is a Boolean is a data type by which you can declare one variable which require only one bit to store and then byte, byte is a new data type which is there in java in C++ also it is there and then char is also there in C programming in java and sort is there. In addition to this there are few more data types like int, long, float, double. If you know C programming then you can see that these are the few data type which is there in Java also there in C. And actually if you know C programming then learning C++ programming is very easier and if you know C++ programming then learning Java programming is also very easier. Anyway but if you do not know C++ programming absolutely it is not an issue.
But, there are many things are very common. So, for the syntax the commands and all these things those are there in C programming also there in Java programming. So, it is an added advantage for the C programmer to cope with the Java programming environment. Now so, for the data type is concerned all these data type that we have discussed called the built-in data type or simply they are called primitive. Because, those are the data type already developed by the compiler, compiler can understand automatically you do not have to bother about anything about all these data type.
Other than built in data type that is more interesting to learn and you should learn it more skillfully. So, that you have you are an expert in Java programming is called the reference data type. Reference data type basically define your own data type or own type of data. As I told you object is also one type of data. So, the reference type it is called.
or it is called the abstract data type or customer defined data type. So, regarding reference data type we will discuss in details in this course, we will learn about what are the reference data types are there and how it can be developed, how it can be used, how it can be manipulated, modified everything right. Now, so far the Java character sheet that means, if you want to write a program.
program which character you should use which character you should not use. Now, if you see the keyboard the co-edit keyboard that is there lot of characters are there, but all keys you should not press to type your program. There are definite sets, upper case letters a to z they are permissible, the lower case letter any a to z you can use in your program writing, any digits 0 to 9 you can use and in addition to this a to z and the numbers.
You can use some special character sets which is listed there in this table. So, these are the characters that you can use other than these characters if you use any other characters then your compilation will be erroneous that there will be a error while the program is compiled. Now, identifier that means, naming of variables or class or methods it should follow certain rule the same rule.
That is followed in C program also C language also applicable in Java. That means, the name should be given to a programmer program elements like variable, constant, class, methods etcetera. The names may consist letters, digits and underscore with no space in between that is very important and then blank and comma are not allowed while you are naming a variable or identifier or any type. The first character must be an alphabet or underscore.
If you start a variable name or class with say number, it sometimes gives an error I mean it usually gives an error in some compiler definitely advanced features it may not give, but it is usually not advisable to follow. Then an name of the variable can be of any length there is no limit, but again unnecessary giving very large name to a variable or type is not a good. So, you should give very short name, but meaningful name and I and one more thing that you should take into account is that the Java programming language is case sensitive. This means that if you declare a variable name as small x and then same variable another variable name as capital X, they are basically two different variable name. So, the case sensitive means the capital letter and small letter matters a lot and.
Here is a few example like the how you can declare the different type of variable for example, int a b we declare the two variable name as a and b and then b is initial as 0 like this one and then the system.outprint is a system one statement by which we can print one message and whatever you want to print you should enclose in a double quote. If you type anything double quote it will print varvatim on the screen. Then, if you want to print anything else then you have to write plus then what are the other things.
So, if you want to the sum is the value of c then the syntax is like this one. So, all these things we will discuss whenever we will discuss the program it is there. Now, I will quickly come to the discussion of array is a one very important structure in Java and array is basically instead of only one variable value or elements you have to store a number of elements into a location.
or memory then it is called the array is basically finite set of is a collection of finite set of elements of same type that mean integer or integer character or character float or float. Now, we will quickly discuss about how an array can be declared in java and then once you declare an array then it is also your responsibility to allocate the memory for the array. How you can allocate the memory for an array and then how you can load the.
values into the array. So, those are the things that we can quickly learn about it. So, if you want to declare an array say x, then the syntax it is there int x within square brackets and then termination symbol is semicolon that you have to meet it.
So, that is also alternative int square bracket x also the same way people can use it that means, x is an array of integers. Then once you declare an integer array, then you have to allocate the memory for the allocation there is a operator it is called the new operator is called the memory allocator operator. So, you have to use the new and the syntax is the like. So, if you new and then type that means, what type of data you want to store and then this is the size and then this basically is the location where it will store.
Basically the x is the array this basically allocate the memory. storing 100 integers right. So, this is the way that the integer can be stored.
array of size 100. Now, so this is the way and then one shortcut also in one go you can define it like this int x new int this that means, the memory allocation as well as defining an array can be done in one go. So, this is the shortcut syntax for this. So, this is the syntax that you should use to declare an array of any size whatever you want. So, this way you can create an array. And, once you can create an array that array can be used using for loop, while loop like this one.
And, here is also alternative way that array can be declared, memory can be allocated and then value can be stored at the same time. So, these are simple syntax that you can follow. For example, here an array of x will be declared which will store that means, size of the array is 4 integers.
And, then the element that will be stored there is 12, 13, 9 and 15 out of which 12 is the first element. And, one more thing that I you should note that just like in C the array index start from 0. So, that means, first array location is 0, x 0 and then x 1, x 2 and x 3. So, total index is from 0 to 3 in this case that means, 4 elements. And array can be used for many purpose we have to maintain. a large pool of data and then that data can be used either for in searching some other element deleting some elements, sorting searching and then traversing and others there. So, array in Java can be done the way I have already told you here is a simple few steps further so that you can follow it and then I will discuss about that array that we have discussed is one dimensional array.
Java can help you to have. Any dimensional array, here I am going to discuss about how the two dimensional array can be declared in java. For example, say name of the array is say myArray, these are your array that you want to develop you want to maintain and then it is a two dimensional. So, for the two dimensional you have to use the two square brackets.
So, this completes declaring an array of 2D and then this basically allocate the memory. So, myArray new int. Here two dimension and then for each dimension what is the size for example, for first dimension 3 and then this is the 4. So, this means that it will declare an array of 3 row 3 rows and 4 column.
So, 3 cos 4 the name of the array is myArray. Alternatively, this is also the one-way syntax that can be used to declare define and then allocate the memory at one point. So, this is the way that two dimensional array can be declared likewise 2D array the 3D array also can be used.
Now, again 2D array initialization can be done by using for loop the way first you have to two loops here you have to use it. Otherwise if it is a small array then you can use this kind of syntax for the singular one dimensional array we have used it in the same way if you do it like this. You will see the Java system will automatically store this in the first row and then this in the second row like this one if the array is like this. Otherwise you can just make it more structured within brackets within brackets like 1 2 3 this 4 5 6 this one.
If 1 2 3 and is a blank then that element will be null and the other element will be stored this way. So, this is more compact one way that the array can be initialized 2D, but this is only meaningful for small. arrays, but not good for the large arrays. Large array we have to use the loop structure to initialize the elements. And then the 2D array with variable size also we can declare.
Here for example, in this row only 2 column, in this row 4 column, in this row 3 column. So, there is a variable sized array also can be declared and here is the quick syntax for variable sized array declaration. Here basically the concept it is there. So, we can declare the 2D array like this the declaration here row size is declared because the number of rows is defined here, but column size is not declared here that can be decided here using this one. So, for each row once it is declared using this one and then for each column we can declare by rolling one for i equals to 0 to i less than row size for each row we have to run this and then this is the basically name of the array.
Then this is the size that you want to do for example, here 2, 3, 4 you can mention it and then column size. So, this way you can build the array of any. Now, likewise the 3D array also possible to maintain in Java also 3D array is bit complex we have a demonstration about 3D array. So, that we can understand here.
So, a 3D array typically just look like. So, if it is a 2D array. So, is a collection of 2D array is basically 3D array. That means, for each this page we can say and there is a collection of page.
So, each elements in one page can be accessed by the number of rows and columns. So, i, j and then each page will be denoted by k. So, it is k is basically this is k equals to 0, k equals to 1 and this is equals to k equals to n, if the n number of pages are there and similarly for each page using just two dimensional concept you can access this one. So, here is an example, this example you can follow it.
Slowly with your own space you can understand that this example basically how a 3D array can be declared and its memory can be allocated and finally, the different elements in it can be loaded. So, this the whole program you can check it slowly with your own time and then you can also try to run it then you can understand how it is there and here you can say for 2D array we need 2 loops. For 3D array we need in fact, three loops for example, in this case we use three for loops one loop for i for row variation another loop for j for column variation for each row there are variation of each column and then for each there is a column on a page variation.
So, this is an example so that you can understand and you can practice it. So, we have learned about. The basic few things particularly Java tools and resources and then the basic Java language subsets and in the subsets only we have certain idea about Java arrays.
The array can be of 2D and 3D array like and then now next obviously, few more things also on the queue that whether Java supports writing recursive program. Probably you know the recursive program. And, if you know C programming, C programming is very good for writing recursive programs and recursive programs is basically an easy way to write very complex and difficult programming. Now, Java in fact, supports recursive program, then it is interesting to learn how we can write recursive program in Java and then other features and the input output in the Java and everything.
So, in the next lectures, we will discuss about. all these advanced features in Java, but before that I will discuss about applet programming. So, a quick overview of the applet programming once it is known to us, then we can have a basic idea about the Java programming flavors. So, thank you very much.