Archives de
Mois : janvier 2022

Java Annotations

Java Annotations

Annotation has been a part of the core Java API from JDK5 onwards. Annotation means adding comments or instructions into the Java code so that the compiler provides a special treatment to the designated element. This feature, when incorporated appropriately, can leverage productivity by reducing bugs in the code. Annotation instructs the compiler to enforce some specific rules. These rules, if violated, crop compiler time errors. Errors are better managed if they surface during compilation simply because error messages often…

Lire la suite Lire la suite

Java inheritance

Java inheritance

The concept of inheritance is one of the most important concepts in object-oriented programming, because it irreversibly affects how Java code is written. Inheritance is a mechanism for creating a new class from an existing class by providing properties and methods. Inheritance is the third paradigm (how to use techniques/mold) of object-oriented programming (the first being encapsulation, the second the class structure). Inheritance can be single or multiple.It represents the relationship: is a kind of Example: A car is a…

Lire la suite Lire la suite

Access to databases with Java.

Access to databases with Java.

We will talk about how to connect to a database with Java, To do this we will use the JDBC (Java DataBase Connectivity) which is nothing else than java database connection. 1 : Establish the connection. We have to start at the beginning and so we will have to use a database, here I will use the Dragon database. then place in the library of your java project a : « mysql-connector-java-version.jar ». And then we can begin our Java project ! Once we…

Lire la suite Lire la suite

GWT (Google Web Toolkit)

GWT (Google Web Toolkit)

This framework has been around long enough but it is not still mentioned as one of the most used frameworks. It does bring some useful features nevertheless. Some developers have been using it for specific actions such UI components because it can be executed in the browser. Let me introduce you to this framework as succinct as possible.  What is GWT? Google Web Toolkit (GWT) is a framework obviously created by Google to create rich internet applications in Java. It…

Lire la suite Lire la suite

Exception (Java)

Exception (Java)

Ok now we can begin: First of all: How to keep calm? Breath and read calmly all information throw at you. How to use? It’s written just after that. Is it ok ? Now we can finally use it ! First step and first example. Take a code where it asks for birthday. You can write a birthday like what’s you have been asking for or you can do like Paul and writes his name on the sentence. First possibility to do…

Lire la suite Lire la suite

Java Swing

Java Swing

Swing in Java is a lightweight GUI toolkit which has a wide variety of widgets for building optimized window based applications. It is a part of the JFC (Java Foundation Classes). It is build on top of the AWT API and entirely written in Java. It is platform independent unlike AWT and has lightweight components. Here you can see the hierarchy of Java Swing classes: A Swing application must contain at least one container class. Here are three types of…

Lire la suite Lire la suite

Apache Struts 2 frameworks is classical but the most popular

Apache Struts 2 frameworks is classical but the most popular

About Apache Struts In the last 20 years on the market, the Apache Struts frameworks is still widely used by enterprises globally. Apache Struts is robust open-source framework for web applications. It follows the MVC (Model-View-Controller) model and extends the JSP API. Struts are easy to set up and provides much more flexibility and extensibility over the traditional MVC approach using servlets and JSP alone. It can be a good starting point for your career as a web developer. What is…

Lire la suite Lire la suite

Java Polymorphism

Java Polymorphism

Polymorphism means « many forms », and it occurs when we have many classes that are related to each other by inheritance. Like we specified in the previous chapter; Inheritance lets us inherit attributes and methods from another class. Polymorphism uses those methods to perform different tasks. This allows us to perform a single action in different ways. For example, think of a superclass called Animal that has a method called animalSound(). Subclasses of Animals could be Pigs, Cats, Dogs, Birds –…

Lire la suite Lire la suite

Spring

Spring

1. Introduction to Spring Framework Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications. Spring handles the infrastructure so you can focus on your application. Spring enables you to build applications from “plain old Java objects” (POJOs) and to apply enterprise services non-invasively to POJOs. This capability applies to the Java SE programming model and to full and partial Java EE. Examples of how you, as an application developer, can use the Spring platform advantage:…

Lire la suite Lire la suite