Class 1 blog


Published on

  • Be the first to comment

  • Be the first to like this

Class 1 blog

  1. 1. How to start programming in Java?This part of the study material is not intended to address still concepts, but rather, you canconfigure any computer window xp or Windows 7 32 or 64 bit and get it ready to startprogramming.
  2. 2. METHOD 1: Use the Shell to run java codeThis point is important for you to read and performers very well using the following commands:• javac.exe, compiler generated files *. Apartir class source code (*. Java). The *. Java is text, youcan create and edit in a text editor, using the syntax of Java.• Java.exe, systems interpreter for PC / Windows, executes bytecode files (files compiled classextension). The *. Class have executable code, bytecode, platform independent, to be executedon a "hypothetical or virtual machine" called Java Virtual Machine (JVM). Is this JVM neutralwho plays this code making a particular code on the CPU used. This avoids having to make adifferent program for each CPU or plataforma.1Shell enters the system and see what happens when Digitas commands: java or javac.You will realize that the javac command is not enabled, therefore the following steps and thentry to use the command in question, the difference observed.Remember watching the second image of this manual and look in the directory where it islocatedjavac command.
  3. 3. To educate the system accepts this command indicating that we should add "environmentvariables" as indicated in the graph. Creating our first program in javaInstall then an editor to start coding (in this case Notepad + +)After that, create the following program and save it in the directory "c: ProgramasJava"Note that the file name must be named identical to the class, using case sensitive.Finally run the program; first compile the program with javac and then running the javaProgram.
  4. 4. METHOD 2: Using the Eclipse IDE ENTERNO(Available at - Section "downloads" download the Eclipse Classic 4.2)This method is much faster than before, it is a method of abstraction for programming while weshould not install the JDK, and load the necessary libraries to program without tread very rodeo.STEP 1: Download and unzip the file indicatedSTEP 2: After that opening the Eclipse IDE, the program requests a folder where you will save theprojects that we believe in java, proceed as indicated in the graph (you must create the folderpreviously).
  5. 5. STEP 3: Follow the following sequence of actions to create a project in java. Look what happens next.Now insert a class as follows
  6. 6. With the IDE, the only line of code you write play, which was noted belowRun the program with the button , watch out.Further notes what happened in "ProgramasJava2" you created. CLASS 2 Step by step creation of the first program in Java using Eclipse1. Run the sequence of actions detailed in the chart.2. Run after the sequence of actions detailed in the chart.
  7. 7. 3. Insert a class called "PruebaAlbum" as follows.4. Now insert a class called "Album", in the same way as the previous step.5. The result after the above steps is a structure as follows. 6. Declare the following attributes within the class "Album"
  8. 8. 7. Then set the SET and GET methods (methods are inserting, modifying and extracting the values that variables may have happened before, "automatically generated"), this operation is called to create getters and setters.8. Notice how you generated the following code block without you had to write something. 9. Define the following constructor. The constructor is a method that must have the same name as the class and is used to initialize the attributes of an object, usually receives values have past, a quick way is to develop a method using getters and setters the previous step.
  9. 9. 10. Now we instantiate an object of class "Album" in class "PruebaAlbum", this instance orreference to create should be made in the main.See how you created two instances, and the way in which you can send arguments.11. In the previous step we created two instances, how can we show these values on screen?We must develop a new method in the "Album", will be called"ImprimirAlbum"12. Then call the method created from the two instances declared in step 10.
  10. 10. 13. And finally see the execution, after clicking on the button should appear something asfollows: Class 3 INTRODUCTION TO JAVA CONCEPTSJava and all Java-based trademarks are trademarks of Sun MicrosystemsWhat is Java JDK?JDK stands de java Developers Kit is, toolset to develop (applications) in countless classes Java.Existent accompanying the JDK that is installed in order to get started programming in JAVA.What makes it different from the other JAVA programming languages?What distinguishes Java from other programming languages is its conception of departure, inwhich language is to create a road that can be used to program in all types of operating systemsand processors.One of the most important features is that the programs "executable", created by the Javacompiler, are independent of the architecture. Run interchangeably in a variety ofmicroprocessors and computers with different operating systems.
  11. 11. Is the language is compiled or interpreted?Java is compiled when the source code is translated into an object called machine code (binary,bytecode) and is interpreted because the machine code can be run on any platform whichshould be an interpreter executing it in real time.To run it, you need an interpreter, the JVM (Java Virtual Machine) Java virtual machine. Thus, itis possible to compile the program on a UNIX workstation and run it on another Windows usingthe Java virtual machine for Windows.This JVM is responsible for reading the bytecodes and translate them into executableinstructions directly on a particular microprocessor.The Java Virtual Machine (JVM).The Java virtual machine is the revolutionary idea of language. It is the entity that providesplatform independence for Java programs compiled into byte-code. Class 4The programmer must establish the associations between the machine model "solution space"that is where to deploy the solution, such as a computer, and the problem is what you reallywant to solve "problem space" that is where the problem exists, the business.
  12. 12. What is an abstraction?Alan kayresumion the five basic characteristics of Smalltalk for an object, the first object-oriented language that was successful and one of the languages that is based on JAVA. Thesecharacteristics represent a pure approach to object-oriented programming.Everything is an object. Think of an object as a variable stores data, allows you "raise requests"asking him to perform operations on itself. In theory, you can take any conceptual componentof the problem that is being addressed.2. A program is a bunch of objects that tell each other what to do rSending messages. To make solicitude to an object, you must send a message to that object. More specifically, you can think of a message is a request to call a method that belongs toparticular object.3. Each object has its own memory made up of other objects. Stated anotherWay, you can create a new class of Object defining a package containing existing objects.Therefore, it may increase the complexity of a program hiding behind the simplicity of theobjects.4. Every object has an associated type. As the saying goes, every object is an instance of a casewhere "class" synonymous with "type." The most important distinguishing characteristic of aclass is "the set of messages that can be sent."5. All objects of a particular type can receive the same messages. As discussed below, thisstatement is really important. Since an object of type "circle" is also an object of type "shape," acircle can be guaranteed to accept shape messages. This means that you can write code tocommunicate with objects of type form and automatically control anything that fits thedescription of a form. This capability is one of impersonation most important concepts of OOP.Booch offers an even more succinct description of object:- An object has state, behavior and identity.This means that an object can have internal data (which provides state), methods (to provide abehavior) and each object can be uniquely distinguished from other objects, ie, each object has aunique memory address . The object-oriented approach Reference is made to the elements in the problem space called "objects" to their representations in the solution space. The idea is that the program can adapt by itself to the lingo of the problem by adding new types of objects so that when you read the code describing the solution, you are reading words that also express the problem. Thus OOP allows you to describe the problem in terms of the problem rather than in terms of the computer.
  13. 13. Why use classes? Since a class describes a set of objects having characteristics (data elements) and behavior (functionality) identical actually a class is a type of data because, for example, a floating point number also has a set of characteristics and performance . The difference is that the programmer defines a class to fit a problem rather than force the use of an existing data type that was designed to represent a storage unit in a machine. You can extend the programming language by adding new data types specific to suit your needs. The programming system supports the new classes and provides all combinations of type providing defined types. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. What is an object? Once a class has been defined, you can create as many objects of that class as desired and these objects can be handled as if the elements of the problem that is being addressed. But how do you make a object do useful work for the programmer? There must be a way to make an application in order to do something, such as complete a transaction, draw something on screen or a switch. What is an interface? Also, each object can satisfy only certain requests. Requests can be made to an object are defined by its interface and is the type that determines the interface. An example with the representation of a light bulb:The interface determines the applications that can be done to a certain object, so there must be acode somewhere to satisfy that request. This, along with the hidden data, define what it calls theimplementation. From the standpoint of procedural programming, this is not complicated. Onetype has a method associated with each possible request, and when a specific request is made toa object, this method is called. This process is summarized by saying that the developer "send amessage" (make a request) to an object and the object knows what to do with this message (itexecutes the code). In this example, the name of the type / class is Light, the name of this particular object is lz Lightand applications that can be done to an object light is on, off, or dim glow. It has created a lightobject defining a "reference" (lz) for that object and calling new to request a new object of that
  14. 14. type. To send a message to the object, defined the object name and is related to the applicationof the message by a point. From the point of view of the user of a predefined class, that is theultimate programming objects. The diagram above follows the format of UML (UnifiedModelingLanguage, Unified Modeling Language). Each class is represented by a box by typing the name of the guy at the top, the data members in the intermediate zone and methods (functions of said object receiving any message sent to the developer that object) in the bottom . Often in these diagrams only show the name of the class and public method, not including the buffer zone, as in this case. If you are only interested in the class name, it is not necessary to include the bottom. Class 5 Primitive data types IN JAVA There are a bunch of guys that are used very often in programming and requires special treatment. Types can be considered as "primitive", the reason for this special treatment is that to create a new object, a simple variable small, not efficient. To these primitive types, Java uses the technique used in C and C + +, that is, instead of creating the new variable creates a variable "automatic" is not a reference. Class 6 CONCEPTS OF OBJECT-ORIENTED PROGRAMMING (OOP) 1 What is OOP? Is to develop programs from objects. These objects waiting messages, process and send Messages to other objects. In object-oriented programming, objects are defined that make up an application. These objects are formed by a series of features and operations that can be performed on them.
  15. 15. 2 What is an object? The answer to this question in terms outside the programming seems simple. An object is a person, animal or thing. It is distinguished from other objects to have certain characteristics and is good for something, or put another way, you can perform various operations with or on that object. For example: A house is an object. OPERATIONS Build, destroy, painted facade, modify any of the characteristics, such as opening a new window, etc. Obviously, each object can be defined in terms of a multitude of features and an extensive array operations. Now in terms of programming, the programmer mission will determine what features and interest to maintain operations on an object. For example, on the home object may not be necessary to know its location and therefore, these features are not part of the object defined by the programmer. The same could be said about the operations. In terminology of object-oriented programming, the characteristics of the object are called attributes and operations METHODS. Each of these methods is a procedure or function belonging to an object. An object is formed by a number of features or data (attributes) and a set of operations (methods). No conceivable only on the basis of data or operations but as a whole. Example: Think about what methods would be needed to make a car turnInsert the key Turn the key This would trigger the electrical system The engine ignite
  16. 16. 3. Classes and ObjectsIn OOP we must distinguish between two closely related concepts, the class and object.Analogous to how to define variables in a programming language, when you declare an objectmust define the type of object to which it belongs. This type is the class.In C, we define two variables X and Y integer as follows:Int X, Y;In this case, X and Y are variables and the type of these variables is integer. The way to declareobjects in Java is the same: Ccasa casa1, house2;In this case, house2 casa1 and variables are effectively but somewhat special, areOBJECTS. Furthermore, the type of objects is Ccasa. This type is the class of the object Variable → Object (X, Y) (casa1, house2) → Class Type (Int) (Ccasa)Declaring casa1 and house2 as objects belonging to the class Ccasa, it indicates that house2casa1 and have a number of attributes (data) and are nPuertas, nVentanas and color, and also anumber of methods (operations that can be performed on them) as: abrirVentanas (),cerrarVentanas (), etc..4. Properties must meet to be considered a language object oriented. POTTING INHERITANCE POLYMORPHISM
  17. 17. EncapsulationEncapsulation is the property possessed objects hide their attributes, and even methods toother parts of the program or other objects. The natural way to builda class is to define a set of attributes which generally are not accessible outside of the sameobject, but can only be modified by the methods which are defined as accessible from theoutside of that class.Ccasa class {int nPuertas, nVentanas; String color;public Ccasa (int np, int nv, co String) {nPuertas = np; nVentanas = nv, color = co;}public void paint (String co) {color = co;}public void abrirVentanas (int n) {nVentanas = nVentanas + n;}public void cerrarVentanas (int n){nVentanas nVentanas =-n;if (nVentanas <0)nVentanas = 0;}public void abrirPuertas (int n) {nPuertas = nPuertas + n;}public void cerrarPuertas (int n){nPuertas nPuertas =-n;if (nPuertas <0)
  18. 18. nPuertas = 0;}}/ / HERE STATEMENT Ccasa casa1 objects and instances, house2;The normal way to declare the class Ccasa is to define a set of attributes that are not accessiblefrom anywhere in the program, but only through certain methods. So, if you open a newwindow in the house casa1, traditional philosophy of a programmer would do the following:casa1.N_VENTANAS casa1.N_VENTANAS = + 1;However, the natural way to do it in OOP is calling the method:casa1.abrirVentanas (1);That method (procedure) will increase by 1 nVentanas attribute. This does not mean that theattribute can not be accessed nVentanas the traditional way (if it had been defined as public,but for that language may be regarded as OOP, should allow for the possibility of prohibitingaccess to the attributes directly. Inheritance.One of the main advantages of OOP. This property allows you to define other descendantclasses, so that the new class (the child class) inherits from the parent class all its attributes andmethods. The new class can define new attributes and methods can even redefine existingattributes and methods (for example, change the type of an attribute or operations performedby a given method.) Is the natural way to define objects in real life. Most people would say, forexample, that a house is a house with a garden. It has the same characteristics and properties oroperations you can perform on a house and also incorporates a new feature, the garden. Atother times, they added functionality (methods) and attributes. For example: a duck is a birdthat nothing. It has the same characteristics as the birds and should only declare a method onthe new class (the swim method).This property enables code reuse and is very easy to take advantage of the existing class code,modifying them minimally to fit the new specifications.Example:Suppose we have constructed Ccasa class and we want to define a new class that represents thechalets. In this case you may want to define a new attribute that represents the square metersof garden. Instead of redefining a new class from scratch, can be used for writing code Ccasaclass as follows.
  19. 19. PolymorphismPolymorphism allows the same message to objects of different classes do these also behavedifferently (different objects can have methods with the same name or the same objectmethods can have identical names but different parameters)Ccasa class {public Ccasa (int np, int nv, co String) {nPuertas = np; nVentanas = nv, color = co;}public Ccasa () {nPuertas = 0; nVentanas = 0, color = "";}}You have two methods with the same name but different parameters. In the first case, theattributes of the object initialized with the parameters of the method and in the second case willbe initialized to zero, for example. Also, if you have two objects and chalet1 casa1 and calls themethod:chalet1.abrirVentanas (2)Will execute the procedure code abrirVentanas Cchalet class and class Ccasa. Class 7 ClassThe classes are the mold for the creation of objects comprise: Methods. - Functions programmed to perform a certain task. Attributes. - Variables we will use in our program. Builders.Method  main (in the case of JAVA)In Java, almost all are classes (objects). The language requires the OOP and allows the possibilityto program using any other technique other than this. For this reason, a program will consist ofone or more source files and each will have defined one or more classes. In a source file candeclare one or more classes and will look similar to this:
  20. 20. class Class1 { ... } class Class2 { ... } Clasen class { ... } A class consists of a portion of the return, and another for the body of the same: Class Declaration { Class body Class 8 Object modelingThe term object arises in the late seventies in computer science, to reference notations toproblem solving, which are apparently different but mutually linked from a perspective differentfrom structured analysis. These notations define objects representing components of the modular system is decomposed to define knowledge. This model looks at reality as objects interacting with responsibilities, where each object could contain internal objects to form more functionality complex.
  21. 21. Were set out different ways to perform the analysis, design and programming, and that varietyis still present.Object Oriented Analysis is a method of analysis to examine the requirements from a class ofobjects that are searched in the vocabulary of the problem domain, in order to represent theuser experience in outlining the requirementObject Oriented Design is a design method for understanding and process decomposition andobject-oriented notation obtaining the logical model is class and object structures and thephysical model is architecture modules and processes as well as static models and dynamic.The Object-oriented programming is the design implementation, where programs are collectionsof cooperating objects. Each object belongs to a class hierarchy, and classes belong to ahierarchy of classes related by inheritance.Object orientation provides elements to develop solutions based on their theory, and are thoseseen in the graph.
  22. 22. What is abstraction?An abstraction denotes the essential characteristics of an object distinguishable from otherobjects and provides conceptual limits to the viewers perspective.When looking abstractions is necessary to focus on the important details, primarily onsimilarities, differences ignoring for the moment to describe and specify some details of thesystem and not go through the relevant unnoticed. A concept can be an abstraction only if it canbe described, understood and analyzed independently of the mechanisms used to achieve itsgoals.Abstractions are always influenced by the observer according to their experience and needs.Abstraction is the recognition of the similarities between objects, situations or real -worldprocesses.The abstraction focuses attention on the external view of the object to separate the essentialfunctioning of the object from its implementation, which is the principle of abstraction barrier.Obtaining the abstractions of the problem domain is the core of object-oriented design, whichcan be grouped into: Class 8 What is abstraction?An abstraction denotes the essential characteristics of an object distinguishable from otherobjects and provides conceptual limits to the viewers perspective.When looking abstractions is necessary to focus on the important details, primarily onsimilarities, differences ignoring for the moment to describe and specify some details of thesystem and not go through the relevant unnoticed. A concept can be an abstraction only if it canbe described, understood and analyzed independently of the mechanisms used to achieve itsgoals.
  23. 23. Abstractions are always influenced by the observer according to their experience and needs. Abstraction is the recognition of the similarities between objects, situations or real -world processes. The abstraction focuses attention on the external view of the object to separate the essential functioning of the object from its implementation, which is the principle of abstraction barrier. Obtaining the abstractions of the problem domain is the core of object-oriented design, which can be grouped into: Abstraction of Bank says that an object represents a useful model of the problem domain or the domain of a solution which has a personality. Abstraction of Action states that an object provides a generalized set of operations which perform the same function type Virtual Machine states that an object abstraction grouping of operations used in an upper or lower level control is associated with a set of common purposes verbs Abstraction coincidental groups a set of operations or unrelated models and are associated with a set of verbs or nouns unrelated Every good abstraction reflects how well you manage the system vocabulary What is encapsulation? The abstraction of an object precedes the implementation of its services, the implementation of an object is a secret for abstraction and should be hidden for its customers, leaving as the onlyanswer to their service commitment regardless of how the fix, making nowhere a complexsystem depends on the implementation of some other object, edging to respect the purpose ofthis abstraction While the abstraction suggests to do, encapsulation is directed at how it will perform, allowing programs to reliably change with minimal effort this barrier. Encapsulation and abstraction are complementary concepts, abstraction focuses on the operation of an object observable. The encapsulation is focused on the implementation which gives rise to the operation. The class of an object that is born must have two parts: An interface for services that are related to other objects, also known as external view. An implementation which is the implementation of services is known as internal view The encapsulation of the idea of having a very complex system that requires much attention and become an object that handles everything internally and can be created easily.
  24. 24. Encapsulation is a process of sharing of elements constituting an abstraction of its structure andoperation, serves to separate encapsulation of an abstract interface and implementation. ModularityThe target an individual program components also reduces complexity of grouping a set ofcomponents for some purpose or common feature allowing components locate efficientlyModularity is performed to divide a system into modules separately compilable, but with certainminimum connections dependencies with other modules.Modularity takes care of packing abstractions in discrete units calledmodules, ie the physically packaged modularization classes and objects.By modularizing takes advantage of the cost reduction of software design and review allowingindependent modules even reuse core modules for any system.To achieve good modularity, modules should be constructed:Modularity is the property of a system of decomposed into a cohesive set of modules with weakcouplings.HIERARCHYA hierarchy is a rank or order of abstractions. A set of abstractions can repeatedly form ahierarchy. By identifying hierarchies in the design, understanding the problem is simplified.The hierarchy of generalization / specialization is formed by grouping abstractions within thescheme which is a type B of A. For example, a car is a type of vehicle, is therefore to define arelationship between classes, where a class defines the structure and behavior of one or moreclasses (single inheritance and multiple inheritance respectively)
  25. 25. CONCURRENCEConcurrency allows different objects to act simultaneously, each program has at least one childcontrol, but a concurrent program can have multiple threads of control: some transient andothers throughout the runtime.The machines run on multithreaded systems truly allow concurrent threads of controlA lightweight process shares memory space with another lightweight process, while thecombination of a heavy process is assigned its own memory space.An object-oriented system can see the real world as a set of cooperating objects concurrently,with each active site is an independent activity center.Concurrency is the property to distinguish an object from one active inactive in a multithreaded. PERSISTENCEPersistence is responsible for saving the state and the class of an object over time and / orspace.
  26. 26. Persistence is the property of an object to transcend time (the object continues to exist evenafter the cessation of its creator) and / or space (the object changes its position in the memoryspace that was created). Object From the perspective of human knowledge can be an object: Anything tangible or intangible. Anything that can be learned intellectually. Something toward which thought or action can be directed. An object has:- State.- Operation.- Identity. IDENTITYEach object is unique, even though sharing the same properties of another object, since itoccupies a different space. That is, an object has an authenticity identidad.This shown in thevariable of time and space. Identity is the property of an object to be distinguished from all other objects.
  27. 27. Relationships between objectsWhen multiple objects relate these make assumptions about each other, including the methodsperformed well as the state of operation. The hierarchy of objects are of two types: INTERFACE AND IMPLEMENTATIONIf a class is segmented this can have two views, one internal and one external, the external formits interface while the inner shape its implementationThe interface of a class provides an outside view and emphasizes the abstraction while hidingthe secrets of the structure and functioning. Initially is to declare all methods applicable toinstances of that class, the statement may also be included in other classes, constants, variables,and exceptions, ie properties necessary to complete abstraction.The implementation of a class provides the internal view, which covers the "secrets" of theoperation. The implementation of a class is to implement all the methods defined in theinterface.A class interface basically consists of three parts: PUBLIC: Statements available to all customers. PROTECTED: Statements accessible only to its class, its subclasses and their friends. PRIVATE: Statements accessible only to the class and their friends (friends refers to what is inthe class and its methods).Relationships between classesIn particular, the problem domain abstractions relate obtained in different ways, the totality ofthese relations are known as class structure. Relations between two classes have two mainreasons: A list of classes may indicate the hierarchical share some characteristics. A list of classes mayindicate some connection semantics.
  28. 28. There are three basic types of relationships: Generalization / specialization. In this, two classes are linked by the relationship Total / Party. Two classes are linked by the relation "part of" Association. Two classes are linked by descent semanticsProgramming languages, specifically object-oriented, providing direct support for somecombinations of the following relationships: Association. The association denotes a semantic dependence, ie, their relationship is applied inconcept and is not required to encode physical dependence.The association is named after the link through which bind classes and indicates a direction tohear the reading direction of the association for their classes.At the time of analysis are extremely useful to indicate dependencies, without elaborating. Anassociation has a cardinality between parts to indicate the number of classes associated withanother number of classes Inheritance.For there must be an inheritance subclass can inherit the structure and operation of itssuperclass.Inheritance is the relationship between classes, where one class shares the structure and / orfunction defined in a class (single inheritance) or more classes (multiple inheritance).The class to inherit property is called superclass and inherited class is called subclass.A subclass can increase or restrict the structure and operation of its super class. When a subclassincreases its superclass is said that "inherited by extension".When a superclass is designed to group functionality and structure, but not designed to createinstances is called abstract class.
  29. 29. IDENTIFICATION OF CLASSES AND OBJECTSHistorically there are three basic approaches to classify:No classification is absolute, because some structures can be mostly favored classes of oneapplication to another, no classification scheme represents the actual structure or the naturalorder. Some classifications may be more significant over other as our interest but not representreality more accurately or adequately but to serve our purposesClassification classic. - All entities with a property or collection of properties common form acategory, the traditional classification comes from Plato, Aristotle then, by means of classifyingplants and animals, and to find answers to questions like: Is animal? Is Mineral? Is it vegetable?One thing can be named according to the knowledge gained from the nature of their propertiesand effects, the practical approach using real estate as a criterion of similarity between objects,specifically objects can be grouped into sets depending on the presence or absence of aparticular propertyConceptual clustering. - It is a modern variation of the classical approach of trying to explainderivative knowledge, this approach class or group of entities is generated to make the firstconceptual description of the class. The long tapering conceptual clustering with fuzzy theory inwhich objects belong to one or more groups of attitudes varying degrees, depending on theclassification considers the functionality of their bodies.The traditional classification and conceptual clustering are sufficient to explain most complexdesigns classificationsPrototype theory. - Is derived from the use of cognitive theory, if we try to classify games andthey can not be properly represented by the classical mold by not sharing similar properties allgames, however the teams theory unifies game ratings as family resemblances. An object classis represented by a prototype object and an object is considered a member of that class if andonly if it is similar to the prototype significantly.
  30. 30. Instead prototype theory unifies the classification of games as family resemblances, an objectclass is represented as an object prototype and an object is considered a member of this class ifand only if it is similar to the prototype significantly.Currently these three classification approaches have direct application to object-orienteddesign. CLASS 9 Primitive Data Types in JavaA data type is an attribute or characteristic that is the data-this serves to tell the computer whatkind of information to be processed, for example, what values can take and what operations canbe performed with them. The most common data types are: integers, floating point numbers(decimal), strings, dates, times, colors, etc.. Below is a table of the most primitive data typesused, and a description of each.Booleanie values that can be true or false. Occupies 1-bit and the default value is false charThe characters are 16-bit and are encoded in Unicode 1.1.5, in other languages are only 8-bitASCII. Occupies 16-bitsbyteunsigned 8-bit integer, ie the fewer number (two to the seventh) and two in the eighth. Theinternal representation is in 2s complementShortunsigned 16-bit integer. The internal representation is in 2s complement intunsigned 32-bit integer. The internal representation is in 2s complementLongunsigned 64-bit integer. The internal representation is in 2s complement float32-bit real mobile with coma. The internal representation is IEEE 754-1985. doublé32-bit real mobile with coma. The internal representation is IEEE 754-1985.Each primitive type has an associated class, you can store the same information but alwaysthrough objects.