 So yes, hello everyone. This is Sabinaya. I'm working here as a software engineer So I'll be giving a brush up for you. You cannot learn a language in a day But I will hope my level best to give my knowledge to you like at least a bit So how many of you are familiar with the object oriented programming? Oh Yeah, everyone then it'll be easy for me, right? So CC plus a C++ or like you learn Java Java everybody So Yeah, then whoever has learned Java are going to explain me like going to interact me and help your partners nearby So Java is object oriented programming language everybody knows it so What are the features of Java So people say it's platform independent. Why is it platform independent? So it come it compiles and gives us a class file which can be run in any environment So we call it up platform independent language and simple. Do you think it's simple? You know simple. Let's see how it works Secure Do you mean to say C++ is not secure? I mean to say PHP is not secure So somebody over here was speaking about SQL injections Right, we can easily prevent SQL injections in Java. So there's something called this You have some query here. Okay, select. There's a table. So there is a table called login. This is an example I'm going for a secure thing So if you are going to choose like for example So there are like two entries for example. I'm just giving you For example, you have a login page Okay, you have a login page. You're going to fish the data for example the first one I am Taking it from the interface Enter the login name enter the password. So if you select if you select from the database I select Star from login Where login name Is equal to if you are going to pass a function with these two variables as such for example a vcd and Password Md5 of whatever You are going to have a SQL injection if you pass the functions this way. So Java has something called as prepass statement that said string off. So if you use prepass statement If you use prepass statement and set the strings over there So you can stop SQL injections this way if a system is not secure if you use or equal to like people will be familiar If a system is not secure if you are going to use this in the user name and password It's going to get you in If you don't want your system to be Like corrupted or hacked by someone you are going to use this prepass statements in Java. This is how we can see Yes, see when I put or equal to directly here Okay, when I set or equal to directly here you can if you have a mysql database you can try With that thing it is going to let you in Okay, it will check if it is or or equal to which is nothing. So or what what is the function or? If you have something one one in your input it is going to let you in right it is or If it is or or equal to it will it is going to let you in So that this is how you make your things secure if you're going to build a platform in Java so multi-threaded Like thread is execution of the time you take the execution of the program That way so people who have studied in computer architecture right scheduling operating systems scheduling for thread one two three So if three threads are having utilizing the same resources, how can we increase the performance of the system? So that is how Java is helping you to have a multi-threaded performance high performance Probably faster It is going to give you a high performance when you really use your code with written and data like you You're not supposed to use your functions data again and again and again. You can use overloading You can use overlighting so that you don't have to replace your code again and again You have this thing called objects and classes, right? So if you initiate Object at some particular time you will be able to fetch it again like I don't want you people to take notes Is it okay? Like listening is the best way some people prefer taking notes But you can have these slides for later and you have many tutorials to learn all these so I'll be giving you a Kind of project to work on after this session probably because there is a Java servlets and Jake where the JavaScript so you're not you're not supposed to complete everything in one and a half hours So it's injustice. I will give you an example on how to do it so that you can try implementing for later So you will realize things when you do it on your own rather me saying things to you you'll be able to do things Sorry, I was like getting interrupted Prepared statement Is a predefined class it's a predefined thing you have it in This is a package Let's come to this. It is a package which has connections Which gives you query which gives you the way how you connect them Java to the database So this prepared statement you can actually It replaces the question mark if you put question mark and you ask the first question mark would get replaced by the username The second question mark to be replaced by the password So this is a prepared statement works If you are Appending the username and the password as a string Then it is going to have a mySQL injection. You'll get it like let's see about it later Specific. I'm just giving example. It cannot be specific, right? Like you should say me if you know something So, yeah, this is the thing. This is the structural diagram for why it is a platform different dependent thing so the Java compiler compiles it into a class which you can Run it in any platform So we spoke about objects object oriented programming language. We had objects Can you can anyone say me what an object is apart from this? Example of car Student. Can you explain? I don't know You all are summer interns. Let's take summer interns as object so summer interns People are from different background, right? Like different year. So some are from second year some are from third year Some are from different department Everybody is from different college university state But you are all summer interns, right? So you can each and everyone can be identified by a specific thing Your all objects consider your all objects. We are identifying you by a specific Characteristic that's how you are unique your name your college your university everything So this is an example of an object. You have different state and different behaviors, right? Somebody feels sleepy after having coffee Does it create a superific effect for someone? No, everybody will be awake Okay, probably you people are awake after the tea so We are taking example of a table car mobile, whatever Everything the state State of mind you people will be having. Oh, what is she teaching? I don't understand anything Some might be teaching. Oh, it's interesting. It depends on the person, right? so it's an object and Yeah, it is similar to the real world objects. That's why we chose you as examples and And You have the state variables the state variables are your department college university and Behavior is a method like if I give an input to her Everybody will handle a question differently, right? So she will have a method of doing it You will have a method of doing it. You will have a method of being everything is different So that's how we define this object. So In Java, we have something called as classes Where you put in the objects where you start the variables where you have the functions So a class is the entity where you have all the behaviors where you have all the states Where you have all the variables everything can even instantiate anything in the And methods everybody knows right instance variables What are instance variables Anyone Yeah, he's exactly right when you run a program when you Create a object the instance is created. How do you create a object? You have a class This will create that instance When you call the thing it will create an instance at that particular time when you have any variable So it will have only that value Be you declare anything before only static variables and final variables will be Predefined and we they are such so you can instantiate any number of variable For example, her name is different from her name So the instance at that particular time matters You you can pre-define anything but at that particular instance are called instance variables Yeah, this is very important the case sensitivity of Java You will have a different variable. Hello with the hitch starting with caps and with lower case everything is different So you are going to name your variables really very cautiously really very cautiously and and Yeah, and you're the first letter of each class should be in uppercase It should be in uppercase the class name should be the starting with uppercase And the method name starts with a lower case and each and every word you will have So yeah, this is it the first The first alphabet These are naming conventions, right? So you people would have known but not everyone follows it. Do you even follow it? Really? Okay What is the name of the iterator variable you give for any loop? No, if you're going to do this, it's absolutely wrong What is the iterator variable for? So you should name it a iterator variable. You cannot name it I I Jkl m no we can be anything you're not supposed to have any variable name as I Jkl You have to name it according to the specification. For example, if you're running a loop for finding a Fibonacci series whatever so you Have the variable name as Fibonacci variable or Fibonacci iterator Okay, this is the first thing you should learn in the way of coding. You should comment it This variable you score is used for this Java dogs like you know, right Java dogs. How will Java dogs be generated? Can anyone say that? How do you write a Java doc? Do you have the habit of commenting the code? Yeah, exactly like so if you have this kind of comments If you generate a dog click for example, you don't have to write anything for the presentation or documents You will just have to generate Java dogs right click generate our job I'll fetch all these things and you will know it is easy to document, right? So any function any program you write you write it this way So that your name will be there the time you created will be there. Why is this function for will be there and If you have specific return things for example at if you use at param Return So at param at author at return everything you can write like you will have the Variables, what is it used for? What is the function used for? So, please like when you write code, please make sure that you write The function and it's you know after you leave we will be there duty bug So have some courtesy on us mercy on us. So Please do it this way be it any language be it any project you work on always write Documents this way so that you will not be feeling anything at the end of the day if Avina sir is going to ask you. Oh, what did you do? You can generate a dog or dog and say these are the things these are functions I wrote today You don't have to sit and write a report It depends on you like I write it before the function before the function star This is this function is for this this function is for this if you want to further elaborate things You can get who get the connection here return return 0 because Return is null You don't have to return anything for this. It's void if it isn't pitch details So if you want to return participant ID you are going to write it here You don't have to particularly write it in the above the function But if you do it, it'll be great. You will have the return there at return So you can specify everything there so that it is not a problem Next program file name Yeah, it should be same as the class name. So this is a simple program which has This is the object That is where you create the object for that so how does Java run like If I run this function, how will it run? Can anyone say like I don't know. So, yeah, you have this static function, right? If you have static function, it's not going to ask for any object So why can't this function run as such because it is not static if you have the keyword static We call it as keyword, right? So if you have the keyword static, it's going to run by you don't have to instantiate object for it So it's going to run by itself It is generating this object And it is calling the function through this object So that's how you get hello Like if you had terminal just try if you're getting it without the object So and then we come to the package. I mentioned it already, right? Dot my SQL dot star like it's a package So inside a package you have related classes for example In the utility view, you know util right util dot star So what do you have it in util like like anyone like one one one each so that I get here. Yeah Okay, then data Collection I couldn't hear you string string Okay tokenizers tokens you mean tokens, okay So these are the examples of things you within a package, right? So you can make your own package called summer internship You can have your own identity when you have your own college Everything like the courses you attend the project you are on everything. So we call yourself as a package subclasses a Class which is derived from the other class like you have a superclass For example again, we can say take the same example You will have fetch details. So we can extend a subclass from this class superclass and Modify whatever you want to you can override or overload the functions. That's how you can extend the classes So you use Public class Extents extents is a keyword you use for Right is extents is a keyword right so extents is a keyword used for deriving the subclasses and What are access modifiers access modifiers? Like anyone, please. I'm not getting anyone. I'm not am I audible Okay, you like you Yeah, exactly you use this access modifiers modifiers for specifying your data. That's how it's encrypted That's how you are you are going to secure it. Okay. This is also one among the examples of Security you call it. So when you have a public key When you have a public keyword, it's going to show everything the whatever the data you have If you are going to have a protected thing then it will not be shown to the world But it will be available among the class package in the subclass With no modify you if you are not using the keyword Public it's going to take its default and It will be available only for the cast in the package. It will not be available for the subclass and the word and It's if it is private. Yeah, it's only for the class So you're going to declare your variables in such a way like For example So these are the variables we have right your department college University whatever So if you are going to fetch the variable, how do you fetch it? object dot Variable so you have something called as being right you use getter and set a certain methods for setting the variable and getting the variable so in that being class For example, you have So if you're going to have it as a private variable, it's a cure if you are going to have a public variable Then it can be accessed by the world You can set it from any way So this is a way of securing things you can access it this variable among that class Like if you if you have it within the class Then it is secure right if you're going to give it to the world. So if I have a chalk in my hand, it is secure No, I Don't know somebody can grab it. Oh stop teaching this nonsense somebody somebody can grab it. So we cannot say But java is secure. We can say java is secure This way and this is an example of access modifier Everything inside this class will be printed. So it is a public class right public class public and Protected you have this thing everything will be visible in the same class. That's why you get the output What is this one one, please? Instance of private class Yeah, it's an instance variable Within the class. So it is called as this dot puv public variable protected variable and This is not defined like So this subclass is extended from the previous class if you try to print the value of this protected variable private value This will be zero because you cannot Hold the variable. So make sure that your variables are private or protected Or public depending on the classes if you're going to have a derived class use public or protected Public or what default and protected don't use private So yeah, these are the non-access modifier as I mentioned already if you're going to have a variable as constant Forever, you are not going to change it declare it as final Declare it as final and then abstract You're hiding it. It is called as abstracting Static modifiers Used to create a class variable. You can put it as static so that it will automatically Get and then what is this? Okay Synchronized synchronization comes with the scheduling, right? So if you are having threads different threads, you're going to have a synchronized variable So that only one thread at a time can be evaluated and Volatile Unexpectedly by the other parts it can be changed at any part of the program if you're naming at it It has volatile the names is I don't get you So strict fp is the strict floating point. How do you have a floating point dot? You have a decimal and zero zero f That's how you have a floating point and if you want it a strict fp. It should be a floating point It cannot be in so if you are specifying your GPA that's a bad example, right? GPA you stick to floating point So this is how you have to maintain the floating point It depends on the package you're using for example, we shortlist you on the GPA It's also considered right? So point nine point two one is greater than nine point two zero So that is how if you if it is strict floating point then you can Actually correlate and manipulate things in a better way, right? So if we if I am strictly saying who people know no less than nine point two seven It's going to come for the summer internship That's when you use the strict floating point But we are not doing that way That's what the manipulation of data you need it depends on your need It depends on your need So if you are going to code With a proper floating point you need exact two or three decimals Yeah So it should be floating You should specify Volatile you can change the variable anywhere for exceptions probably like I can say if you are from IIT I can give you a GPA thing of 0.5 So you are if you are from IIT I can consider even if you are eight point something So that date the volatile variable it changes often, right? So it depends on the exceptions you have we will go to the types of variables Local variable class variable instance variable everything like we are coming back again and again. We have seen examples, right? So you can get to know what are local variables Within a class you are going Within a class circle class variable within within a function Within a function within a scope. Yeah, exactly within a scope. It is a local variable Class variables are static like we can define it final static anything. They are called class variables instance variables Specific to the particular object. Those are called instance variables So, yeah, this is an example of Types of variables. You can just go through it if you are not getting anything If you declare it globally it's a global variable So these are called class variables These are called class variable which are within the class if it is a global variable then it can be Put above this as well for example, if you have something mathematical computations You can have pi you can have log values as final values, right? So you can have that as global Do you find any problem with this? So when you run it goes to the main It creates an object bar It is an object variable. It's an instance variable where bar dot member bar is equal to 23 Static Equal to 88 So the value of the static variable will be printed and print of bar value like it goes to the other function So, yeah, I asked you already like what is public static void menu first start writing public static void main string arguments So, this is it. What is void? It's not going to return you anything. It's the return type static Yeah, you have to you can run it as such like you don't have to create an object for running the function public For everyone it's access specified. So what is abstraction? Abstract is hidden Hiding yeah, exactly So hiding the definitions in capital in encapsulation one one one I Can skip it like if everyone knows it Yeah, exactly inside a class. You have the data variables functions everything. So inheritance Can you be louder like so everybody can hear it Yeah, exactly so if you if you don't want to write the same code again and again and again So we use inheritance you can use whatever is pre-existing in a new class with different modifications required and Polymorphism Yeah, so there are two types of polymorphisms available in Java to Function overriding and function overloading. We all know this right abstract class cannot be instantiated You have to override all the functions if you are extending an abstract class So, did anyone use the abstract thing in your code? Yes, where? So I need a example I understood the definition. I'm asking if you have used in your code So did everyone understand the property of abstraction abstract classes can we move on or If anyone have doubt you can ask again like we will ask the person to give another example, okay How do we implemented Yeah No, it's a key word like abstraction is hiding the definition of an object abstract class use abstract as a keyword Yeah, as he gave the example, I'll go with it. So you write whatever you want For example, the shape has how many edges How many vertices how many angles can be formed everything you can list things here You are going to extend this class if you are going to have a subclass for example public class Rectangle extends This Shape so if you're extending a shape you are going to override All the functions You're going to implement all the functions which is available. For example, if I'm going to get I Have a function to get Edges How do you find the edges if you know the number of vertices or if you know the shape if it is a cube or Cuboid or rectangle or a square or a circle or a spear it depends. It's a shape, right? I'm not mentioning it is a two-dimension or three-dimension so if you're going to implement it you are going to use this word extends and you're going to implement all the All the functions here, so that's how it is abstract It cannot be instantiated, but can be subclass so you're extending all the properties of the upset class in your subclass You're going to make it your way. You can call it two-dimension. You can call it three-dimension by the subclass So that is how it is called an abstract class So yeah, the same example they have given here find area draw shapes Why do we use an abstract class? I'm just saying you can override it like you can It depends on the shape, right? So they are declaring the variables and what are the functions which can be possible Okay Then you don't have to use it if you feel like it's a waste of time to Redefine everything then don't do it If you if you have some generic stuff For example, you can have the number of edges, right from this class. You don't have to redefine it every time You have to redefine the area function Rectangle, it's different a square is different. It's going to be different for triangle It's going to be different for the surface area of the cuboid is different. Everything is different so that things you can redefine it but the number of edges the Dimensions can be same So it can be got from the abstract class. You are going to just extend it for finding the area finding the volume Etc. Did you get it? If it is mentioned abstract if the method is mentioned abstract you have to implement it if it is not So yeah, we finally came to polymorphism Polymorphism is of two types function overloading and function overriding So in overloading you have More than one function with the same name same name. So If you have the same function name, which one will it call? So it depends on the parameters you pass and depends on the number of parameters and type For example, I can have it So if I'm calling the function of rectangle with two variables length and width Both can be in It can be a float It depends right. So we can use the same function with different parameters or if you are going to find the area of Of a circle, we have only one radius. So we can pass the function for only one. So it is different find area So this is an example of function overloading Just go through it if you have any Problem just let me know. Is it okay? So, this is overriding So, how how is overloading different from overriding? I'm asking like examples Okay, you So Overridden by the yeah, so if you're implementing so extending if you're having a super class If you are implementing sorry extending the class implementing is used for interfaces So extending the class Then you can override the functions as you like So this is overriding. We had a function We had a function some and overloading right in the previous example now we are going to override the sum with a ride ride is an object created for this class going to This function and not the function of the class super class So it is called as function overriding. So finally I came to threads. What is thread? We mentioned it already right lightweight process So, how do you call it lightweight? Yeah, while executing that time taken the scheduling of different processes everything you call it is a thread it's a single four is a execution of a program and Thread is implemented by renewable interface So we have read this right so if they are going to have a quiz it might be a question like I'm not Setting anything so don't ask me if it doesn't come. It is very important a thread implements runnable interface You can have a thread like this class my thread extends read Class or you can implement this as runnable implements runnable So you have three things in thread right start run and Stop so apart from that you have weight You have sleep So for implementing all this you can extend the class which is thread and Runnable is like you have You don't have to start a thread by dot start if you have a test dot run It runs run as a Function which is used to run a thread like you can start at a different point, but run it will run If you have a thread Create rate implements a runnable interface or extends. Yeah, so I'm not sure about it like Sorry, I will get back to you So these are the thread states available. So if you are going to start it It goes to the runnable state and then it runs with a run function You can make it sleep weight or it depends on the processing you are going to schedule The optimistic way of scheduling things and then you can stop it by dot stop Multithreading is possible right in Java. Have you used multi-threading? Where like one where? Okay Okay I'm not able to Socket programming you have implemented this threads So second years, did you try? Probably you should go and try so yeah Sleep is for the bait Wait process like it doesn't do anything the thread will be handled a hand up as it's the memory will be cleared Yes It will make up so Exception handling like you get exemptions right while you're trying to connect to the database where you're trying to Okay, if I am So this class rectangle if I have this int int if I am passing a float In the sum it's going to give me an exception that I cannot add to the add these two things because they are not So it's an exception you have two types of exceptions like Runtime exceptions and normal exceptions you get the runtime exceptions only when you are compiling the code and Normal exceptions like input output you get the database exceptions everything So the problem Which is arising during the execution of the program like you have to handle those things in the exception handling Where do you write the exceptions? In Java, yeah, exactly try catch you're going to write the catch. What do you usually write in catch? No one one one, please one What do you write in catch? Yeah? Yeah, you write what to do when an exception is thrown what to do like you want to have a log Like if you're debugging if you're not a debugging mode if you want to know what the exception can be You're not supposed to write system.out.println You are not supposed to write system.out.println Okay, you are supposed to write this stack trace print the stack trace or what you should do about the exception Don't never write system.out.println in your code unless it is really required You should always use a debugger You know to use a debugger right you will know to use a debugger like you have the Breakpoints just go through the variables that way you please don't write system.out.println You're going to get scolding if you're going to write system.out.println. It is not supposed to be a good code Okay Have these things in mind first one you name the class properly you put the variable name properly You give a donkey as a donkey call it a donkey. You don't call it IJK So yeah And then the third one is don't write don't ever write system.out.println if you want to debug your code There is a worse practice you can ever have in life So don't write SOPs You catch the exceptions you actually handle the exception. You are not supposed to print Oh, this is inside this exception. I mean I'm wrong. Don't do that So this is the exception hierarchy Like all exemptions are throwable so if it is a error or exception and then You have two types runtime exception the runtime exceptions mostly have null pointers like you forget to Start to declare a variable or something like that then you get this null pointer exceptions for example If I click on a login button Without entering anything and if you don't have validation it will directly go to the database So in the set string method we had it here, right? If you put it then you will get a null pointer exception If I log in as such without any validations Number format exception we use it for in turn float, right? So that example class cast exception index out of bound exception is used in arrays input output exception SQL SQL exception is like if you are Very strong If you forget something It's going to throw you a SQL exception. Yeah, this is how you catch the exceptions You have the code in the try block you always write the code in the try block If it is having an exception it will be catched in the catch block and finally you are going to close the database You have finally things to do whatever you want to do you do it in the finally block constructors What are constructors? One one one, please Like everybody wants to speak but when I ask one nobody wants to yeah So to initialize the members of the object you use constructor. Do you have to write a constructor every time? to be called automatically when you instantiate object So what is the return type of constructor? No return type a Constructor doesn't have return types and the name of the constructor will be as same of the class So this is an example of Constructor you will it will be invoked automatically when you create an object You don't have to particularly call the default constructor unless if you really want to yeah, we can have You can have a constructor here as my constructor of 20 inside that you can have 20 comment. Yeah, you can have the parameters you can define the parameters So you can go through all these things as references The first one is the best It's a Oracle thing so you can download the PDF from the Oracle and you can go through it That's why I said you not to take notes the first you are going to get everything online It's about just giving an intro so that you don't feel weird some people Few people want to have some introduction so that oh I have to learn this I have to learn this That's why this is this section is for this is not for learning the entire Java on in one and a farts like it's It's going to be one So just go through all these materials We will switch to Java script like totally tired Okay Where do we use JavaScript? Have you people use JavaScript? Yes, how many use JavaScript? Many good number So everyone can answer like one from this row. What do we use Java script? Okay, from this side, is he right? Yes, so Exactly, you should say the thing has client side So for developing the application and if you want to save something for the client If you want to have a dynamic pages if you want to have validations you go for Java script. It's lightweight It can be embedded directly into HTML. So where do you actually write the JavaScript? In the head the you can write it anywhere in the JSP you can write it anywhere in the HTML But it is a good practice if you write it in the head so that people don't have to scroll down way We have written the Java script Okay It is used for the client side Computations so you write script to validate things a scripting scripting language is like It is an interpreter waste it is not compiled it is not compiled So you have the faster loading of the pages So you have to write the JavaScript inside the braces inside the script thing and The type should be text slash Java JavaScript and what can a JavaScript do? Yeah, as I said like you can do client side validations You can react to an HTML element. Say for example, we have these things, right? So If you register for Facebook you when you enter the birthday it automatically compiles like if you are more than 18 or 16 So it is reacting to the pages, right? That's why we use JavaScript put dynamic content on the pages and Creates a client site versus then if you have keys or the sessions So if you log in if you use a stay signed in So it will keep you signed in until you yourself log out, right? So it is a session variable Yeah, this is what like This is the basic structure where you can write a JavaScript. What is What does it do document or get element by ID it gets the reference to the variable Dot inner HTML So if you run this if you run this in your browser, what do you get? You will get the current it like now So this ID demo We are changing the inner HTML. We are changing the inner HTML Inside the P we are going to write it inside the P as date This is a as I said you like inside the head you have to write a JavaScript for readable things It is easy to debug. How do you debug a JavaScript? Function, how do you debug? Yeah, you go to the browser console Click on the JavaScript. You can easily debug it. It is an interpreted language You don't get the logs as Java, but you can get easily Debug it you can also use external Java scripts for Very readable code. We what what do we do? We write a form In a web application. We write. Oh the login name should be this many characters. The password should have a Special character should have uppercase should have a lowercase should have numbers Whatever it's your specification if you're going to write it separately my JavaScript or chase it will call itself You're going to write inside the source for fetching the JavaScript and Have you tried this? working without semicolons It's a new line It automatically takes it like you don't have to put a semicolon for JavaScript And this is how you should comment it double slashes and So you have different types of boxes in JavaScript alert confirmed prompt You can try JavaScript in Online, right? You can try it. It's pretty easy So these are the events you can say Have you tried on focus? Like when you use a Google user name every time if it is on focus it will give you a blue color Like line border so it's on focus on blur on there. It removes the blue line On change it checks if the user name is already existing On load in the web pages loading if you write certain things it'll be Automatically loaded and load also you will on unload you can reset the things Mouse hover mouse down You can try all these things in JavaScript on error On key down on key up on select So, yeah This is how you are going to have a validation thing for the client side You have to write a validation in the Java side as well But first for the client set to have a lighter weight so that you have all the checks at the first without taking to the action of the Java So you have this thing Bar X. It's a very bad way of giving a variable name The text value will be got from here if it is null you're going to have go fill the first name Till the last name you can say whatever you want. You can have regular expressions for If it is an email phone number state Landline numbers Everything you can have pin codes can have a regular expression for all these things you can go and see regular expressions It will be available on So Yeah, so null is like you don't enter anything and press on submit you get have the null values Example like I give four spaces Okay, if I have four spaces when I trim it it will be become a empty string. You can try it So it will be like empty string when you trim it trim the string you trim the string right every time you validate So it will have a empty string so For every form if you are going to pass my form to the validating this is how we are going to This is for validation of the email We have a regular expression for the email if you don't want to do it that way You can have your own email validations So you are going to check at the rate of and dot and you are going to have how many Strings you require after the dot and before the dot. So what is a cookie? What is a cookie? Yeah, it is stored in client set. What is a cookie? It's a variable or object like Whatever we want to save it as a in the session or we have to save it for the browser We save it as a cookie. So it's a normal. It's normally a variable So it is stored in the Vista's computer and then you can create and Retry whatever you want in the session document object Document object is used for getting the values using the ID right document dot get element by ID These are called document objects in the JavaScript. It defines the property of object or the HTML element. You can also be used to create and delete the HTML elements Say for example For example, yeah today we have four sessions, right? So if if it is a pay which has dynamic data for example, I'm having Oh this day in the training. How many sessions do you have if I enter for after entering for I can have What is the topic? How long it is going to be and I can ask it accordingly Who is going to take it and? What topic how long it is going to be is it an interactive session or a lecture? So we can have interactive elements when you go for the DOM object using these we can have interactive things Yeah, getting its ID See for example, if you have a PID is equal to When you Document on Yes, it is in the browser So you get the object using the ID You can create or delete it like we used it right dot inner HTML is equal to date You can replace the date by anything after five minutes So these are the examples you have for the document objects and CSS Are you people familiar with CSS? You can get it easily you don't have to Write many things in CSS like what do we use for CSS inside the script? What do you write? text bar CSS Text bar CSS that's how you write CSS and if you want to explore more on CSS and designs you can go to bootstrap You can explore many things with CSS and from bootstrap you can create your own design Change your layouts for like each one hard can do anything. It's an interactive thing. So if I Resize the window it will change everything automatically. So you can use a interactive thing using bootstrap You can also create one if you're interested So these are the references from where we have taken the things that's it for Java and Java script so I Don't have slides for JSP. It's not I'm not going to bore you anymore But I will give you an assignment like you can try it you can try it if you're interested So you will feel better when you are working things out. I want to create a page web page Which has just two things login names and password. You have two buttons submit reset So first create a page Which is very easy page simple HTML elements. You can take it from pallet you you have two inputs two inputs login name user name So in the login page you have two inputs You have you write the input in HTML. Everybody knows HTML, right? So, yeah, and the password submit and reset I want the user name to be unique Yeah, you are going to fetch it from the database. We're going to have a user ID, which is the primary key User name it should be distinct as well and the password Which is encrypted? You always use a encrypted password. You can use a string as well But when you start things you can use mdefine encryption or SSL encryption anything So you use any encryption you desire so On submit, I'm going to validate it. I'm going to check if these two are strings if it is not null You you have to have a proper validation. Okay, everybody So on reset it should be resetting all the errors all the borders everything Java server pages server pages So it works on HTTP You just create a new project Okay in net beans or eclipse create a Java web application first. Yeah Create a Java web application create a new JSP With this thing and you have to write the validations in separate JS. Okay validate the JS You are going to have a separate folder called validate folder Inside that you have the validations. Whatever you write proper course. Okay then How will you check it? You should how do you access database in Java? You have the driver right JDBC ODBC driver So there is a driver JDBC ODBC bridge. You can install the driver Automatically said when you have a Java web application, you have to include the driver in the library So that you don't get errors. So third one is you create a database connection class in this class you will have You're going to mention the driver you use connection is equal to get driver off 3306 what is 3306? The port my SQL connects with your computer 3306 local host your Database and your password of the database you're going to get the connection. You're going to throw the exception check first Your database connection works Okay, then you will be validating that in the Java side validation So on press on submit you have to go to the JavaScript first if it is okay, write Java validation Write the same Java validation if you are going to say my password should be at least eight Characters length and if it is going to have one uppercase at least one uppercase one Special character you have to write the same validation in the Java side as well Okay, you have to write the same validation in Java class as well. So you are not Misinterpreting anything with the page. So, yeah, then You're going to check it. You use prepared statements. Okay, you are not going to append the string as such in the query You use prepared statements and then check if you are able to log in After logging in you can say if it is successful you can say hi With a username If it is not successful, you have to write the exceptions. You have to handle the exceptions What are the exceptions possible my a square exception is possible if your query is wrong if the input is null You have a null pointer exception So if you try to do this you will have a basic idea on how to develop a web application So it is all Java JavaScript everything just start writing things so that you will be familiar. I'm not Saying things will not make you work. So just go back Try things out. You can make this easy page. It will not take more than one heart If you start with installation everything together, it will take only one heart for you to write this Even if you are very slow So try it out We can use but I'm using Java, right? Yeah, you can use PHP You can use PHP, but the point is you are going to try these things with Java Okay in PHP the Database code everything will be in the same page if you go to the browser You can see it in the same PHP page. You get to see the Classes you are going to write. Sorry functions are going to write So here it will be encrypted you will not be able to see the classes class files, right? You can have But it can always be linked You will not be able to see the Java site validations if you are going to right-click and view source So can you try it? If you have any queries like You have to create a database That's why I said you are going to create a database and you are going to connect the database using this driver You are going to first create a database create a database create dummy entries Create entries distinct entries. You have to have proper primary key and everything You create a you create a database with a table known as login or user whatever you want to just have these two things Three things one is the ID one is a username one is the password Have these three things. That's enough. You can do this page It's very easy. You try implementing it if you have any queries you can always contact me I sit in a 4987 The extension is 4987 you can call me Abhinaya and my ideas It's a bi in a way a not a b hi in a way It's going to fail and extension is 4987 Please try to do this thing If you have any issues, please get back to me. I'll be able to help you This class is in Java you can you call it a Java class You are Nice. So if you are having if you don't have any problem with this client side validations in your JavaScript And if you want to say any message to them, how do you say? How do you say? Oh after that I log in you get it like hi Abhinaya You're logged in. How do you get it? You save it in the session Like you can have session variables You can have a class summer interns, okay? I'm having my your department college name university name of the person everything You're going to set the summer interns object in the session. You can get anything you want For example, I'm a person, right? so a person will be having an email ID to register will be having a name email user name user type gender Everything college So if I have to set everything you want to have everything in the session you can set this object You initiate the object person Person is equal to new person. You can set the person In this session So you can have the messages. Hi welcome. You're logged in successfully Okay, you can set it and you can also set it through So how do I display errors? You can have a limit element here Which is actually hidden in the first Pid is equal to something display is equal to none display none you are going to hide it But you will have the message before Or you can use inner HTML So if the username is not matching it's not in the inside the database you can have it that way You can give your own messages You can actually hard core it here or you can take it from application properties You can have number of messages which are required. You have it in your property file. You can fetch it You can fix the error messages You will know like when you actually try settings Okay, if you have any problem get back I think it's okay, right? Any other queries? Will you be able to try it? Yeah, if you have any queries always get back Thank you Any other query? No, everybody knows Java Okay Java server page. It's a page which has You can have HTML elements in it. You can also have a You can also write Java in it. How do you write Java inside a JSP? In this you can write Java and If you write it as such it is a HTML normal HTML thing input P Hatch tags, it's a normal input So this you call it as a JSP a page a browser like which is visible to you It's a Java server page. There is servlets our Java classes Where you validate things where you validate you have functions It is called a servlet you you have HTTP response HTTP request so for processing the request you have the servlets So say for example, if you're connecting to a database you can use servlets But servlets are very basic. You can try it with servlets. Then you can go for struts hibernate spring In the later part like just get it done with the servlets first Create a simple Java class. I don't want you to say it's a servlet or a strat file whatever You just map it and you write things in a class Java class Anything else Probably yes Probably no, I don't know Like yeah, we have that this questions. I'm not sure if you will be taking taking it You might be taking it Like who are working in Java projects? So, yeah, like it depends on the quiz as well, you will be sorted out According to what you are strong and they are more Java projects Cdeep will have Django for see will have Django if you are going to Moogs, it is also Python There are two more project which you are going to implement it using Java web So the probabilities, I don't know it's your fate So if you will be taking the quiz, yeah, do it right It will not be very hard