Sunday, 26 July 2015

JSP

Let’s start with jsp

JSP (java server pages) as we learnt that jsp is used for combine html tags and java methods.  Let’s check how we can use both of this.


Start to create web project :

Reaquirements  : -


  •                 Eclipse/NetBeans IDE,
  •                 Apche Web Server  or Glassfish server.
                                We need server for run jsp files. We cannot run this file without web server.

My first Web Project in Eclipse IDE.                 


Strat eclipse IDE.


  • Click on file menu. In that select new option.
  • Find dynamic web project select it. 

Or if you can’t find web dynamic project select other in that type dynamic you can see dynamic web page in web folder select it.



  • You can see this popup box.
                Type your project Name and select new Runtime.
                Select apache server to that latest version. Here it is apache 8.0.



                Now you can see new popup box in  that you have to give path to apache home directory as seen in image.

            Then click next button again click next button. 
Then new popup box appear in that you have to mark the check box to generate web.xml.

Click finish button.


Now your project created.

Now in project explorer you can see  your project.

IN web content right click on that in new menu  select jsp .


Type your jsp file name as index.jsp



To run the jsp file press ctrl+F11. You will see this popup in that select server here it will Apache.

Now output is like…




Sunday, 12 July 2015

Java OOP Concepts

Java OOP Concepts:

      Java is not fully Object Oriented Programing Languages Because java Provide Primitive Data types Like int,string etc.
     
      Java Provide Following OOPS:
  • Object
  • Class
  •  Inheritance
  •  Polymorphism
  • Abstraction
  •  Encapsulation


1.Object

   -Object is nothing but just Blueprint Of Class Means it contain Properties And Behaviour Of Class.
    example: real time Example is People, pen.

2.Class

  -Class Contain Methods and Properties. so we can say that Collection of Object is nothing But Class.

3.Inheritance

  -Inheritance is Process  or Scenario  for accessing Parent class Properties .Means access Properties and Method of Parent class into Sub Class.

4.Polymorphism

   -In simple Word Polymorphism is way to Perform one Task in Multiple Different Ways. Real time Example is Speaking way of People and Birds are Different.

5.Abstraction

  -Abstraction is way to hide data and just show functionality. Example is Like Mobile Phone Meassage ,Mouse etc.

6.Encapsulation


 -Bind data and Code in Single unit. Example is Medical capsule and Bean class .

Saturday, 11 July 2015

Java Basic Introduction


What is java?

 Java is Programming language developed by sun micro system in 1991.
 It is current “Hot ” language and almost object oriented. It has Vast  Library  of Predefined  Objects and Operation and for running java code require Development tool kit.

Why Java Different than Other Languages.

-Java Provide Some future which is Different than other Languages.

1.Java is  simple

Java is simple because   syntax of java is same as C and C++. Programmer who familiar with c and  c++  will have much easy to learn java Languages.Also provide automatic Memory management so no need to Write Code For That.


2. Java is  Protable.

There are no implementation-dependent aspects of the language specifications. For example, the sizes of primitive data types and the behavior of the arithmetic on them are specified. This contributes to
making programs portable among different platforms such as Windows, Mac, and Unix.


3. Java is  Robust.

Java provides support for error checking at various stages: early checking at compile time, and dynamic checking at run time. This eliminates some situations that are error prone such as pointers in the C language.


4. Java is  Multithreaded.

Java provides support for multithreaded programming  like in Game Background Sound when playing game.


5. Java is  High Performance.
 java has JIT. The Just-In-Time (JIT) compilers improve the performance of interpreting the byte code by caching the interpretations.


6. Java is  Distributed.
Java offers extensive support for the distributed environment of the Internet.


7. Java is  Architecture neutral.The Java compiler compiles  source code into byte code, which does not depend upon any machine architecture, but can be easily translated into a specific machine by a JVM for that machine.


8. Java is  Dynamic.
New code can be added to the libraries without affecting the applications that are using the libraries, run time type information can be found easily, and so on.


9. Java is  Interpreted.The Java compiler compiles the source code into byte code, which can be executed on any machine by the Java interpreter of an appropriate JVM.