Monday, June 3, 2019

History and Development of Programming Languages

History and Development of Programming LanguagesYash OjhaIntroductionProgramming languages play the most important role in the universe of discourse of divers(a)Softw argons. Application, and Webpages etc. Just beca phthisis of the existence of planming languages forthwith everything related to New Technology is possible. For example the various Social Networking sites that we use is a result of Programming Language, the Mobile ph singles that we use in our daily life is a brilliant outcome of architectural planming as every IC in the circuit of the mobile phones are course of instructionmed due to which it works.The most important outcome of Programming Language is the creation of Operating Systems (OS). OS is something without which we brooknot use our PCs or Laptops or even our mobile phones. OS coiffures as a base for every single function of a doojigger to work in short it provides an important platform for the working.If no courseming languages were introduced hence today it nearly impossible for the people to use computers, mobile phones, servers, and various other things. But thanks to the developers of the various types of Languages that made peoples life very easy and mobile.1 solely about coffee treeJava was developed by James Gosling at Sun Microsystems in 1992 and was officiallyreleased in 1995. JAVA Technology is a programming language that is use for meetingthe objectives of current challenges and opportunities in the present computing realm.Java Virtual Machine (JVM) JVM is an Interpreter for JAVA programming language, i.e., it is the only way to convert a Byte commandment into machine language. The Byte Codecannot be converted using any technique other than the JVM. Therefore as I said above Byte Code somehow helps Java in being secure.Java Run judgment of conviction Environment (JRE) We all know that that the major problem with the programming languages before JAVA was platform dependency i.e., if we want to run the commandment bundled in Windows Xp in Linux, this was not possible as for that we need a special compiler which works in Linux only. So to solve this problem JRE was launched and became a part of java. each Operating System take up some mandatory files that are needed to run java on that particular OS. So in short JRE in the collection of all those mandatory files needed to run java on various OSs plus JVM.Due to JRE today it is possible to use the code written in some OS in any other OS.So JRE made JAVA completely broadcast INDEPENDENT.The byte code is loaded into JVM using the Class Loader.JIT (Just in Time) JIT works as a verifier. It verifies the Byte Code first whether it is infected or not or whether it is keeping some kind of virus in it or not. If found clean it forwards the Byte Code to the JVM for further process.JIT is completely responsible for the SECURITY of JAVA.Lets see the whole process graphically.A.java A.class2Now Ill show you a basic program in java with its output.clas s Sample national static void main(Strings)System.out.println(Hello World)Lets talk about the main() function.The main function is made up of 5 things. Access Specifier Function Name overt static void main() Parentheses Access Modifier Return TypeJava FundamentalsAll programming languages have its own syntax and reserved keywords. JAVA alsohas these kind of language inherents.Basic fundamentals of java includesJava KeywordsData Types jural and Illegal IdentifiersOperatorsLets see every fundamental in detail.Java Keywords Keywords are the words that convey special meaning to the language compiler. These are reserved for special purposes and must not be used as normal identifier names.Data Types Data types are keywords are means to identify the type of data and how much memory a protean inevitably to carry out a particular operation.Data types are divided into two typesPrimitive Data Types (8 types)Non Primitive Data Types (User Defined 3 types)Legal and Illegal Identifiers Ident ifiers are building blocks of a program and are used as the general terminology for the names given to different parts of the program viz. variables, objects, classes, function, arrays etc.3Operators The operations being carried out are represented by operators. The operations (specific tasks) are represented by operators and the objects of the operation are referred as operandsClasses in JAVAClass is a collection of objects of similar types of objects. Objects are nothing but a buffer or an area and are defined by something which have some property and behavior.In java objects are created in the HEAP Memory at bottom the Java Virtual Machine. syntax for creating an object in javaClass name object name=new class name() new is a keyword of java which when used creates an object in the HEAP. Now whenever we use the new keyword a space in created in the HEAP memory inside the JVM for the object at runtime.When we print the reference variable of some class then it prints 3 thingsClass name symbolHash codeGraphical representation of HEAP and other memory areas operable inside the JVM.4Principal of Object Oriented Programming (OOP)The object oriented programming has been developed with a view to overcome the draw backs of ceremonious programming approaches. The OOP approach is based on certain concepts that helps it to attain its goal of overcoming the drawbacks of conventional programming approaches. There are 4 general concepts of OOPPolymorphism hereditary patternAbstractionEncapsulation (its a part of abstraction) Polymorphism It is the ability for a message or data to be processed in more than one form or it can simply be defined as one name used for many tasks which is used to speed up the compilation time. Inheritance This is a parent- barbarian relationship between two classes. In this, the child class object inherits some properties of the parent class object.AbstractionAbstraction refers to the act of representing essential features without including thebackground details or explanations.Abstraction is divided into two partsAbstract Class Abstract class is used to define a rule.Rules in abstract classAll the task which we can perform in a normal java class can also be performed in an abstract class.In abstract class we can define normal method as well as abstract methods.It is not irresponsible to have at least one abstract method in a class.If a method is abstract then the class should be abstract.We cannot represent (cannot create the object) of abstract class.Abstraction is achieved using extends keyword.Interfaces Interface are pure abstract methods. A class implements an port, thus inheriting the abstract methods of an interface. An interface contains the behaviour that the class implements. The class that implements interface is abstract.syntaxinterface mydeclaration of methods5Rules in InterfaceWe cannot instantiate of an interface.Interface are used to define the rules purely.All the methods of an interface are by defa ult public and abstract.In case of interface we use the keyword implements.If we define any data member inside an interface than by default it becomes static and final.Interface is used to achieve Multiple Inheritance.PackagesPackages is a collection of classes and interfaces. No class can exist without a software package included in it. This is the rule of OOPs. But when we open a class we dont al ways make a package in that class, so in this case the rule of OOPs is violated. So to avoid this problem JAVA has given a feature in its compiler due to which when we compile the program, the compiler automatically creates a package of the respective class during the compile time. Command to compile the program with a package javac d . p.java Name of the expulsioncurrent directory is the same location as the class where the package is to be made. Destination. d . is called the switching tool.Program with a package can be punish by using the CommandJava .Exception HandlingWhen any abno rmal condition that comes in a code which can be handled then that situation is known as Exception Handling.For every exception there are exception classes and exception methods to handle that exception in java by default.We can easily handle these unwanted exceptions by using try and becharm block. Try is used to detect exceptions in a program and catch is used to handle thatThe finally block If an exception occurs in a program then the try and catch block will be penalise and then the program terminates in normal condition. But in case of finally before the termination of program finally block also executes.Syntaxtry-catch-finally-6ThreadsEvery process is divided into two categoriesHeavy system of ladings ProcessesLight Weight ProcessesHeavy Weight Processes These processes are those processes which stores a separatearea in RAM.Light Weight Processes These processes are those processes which occupy memoryunder the heavy weight processes.These light weight processes which occup y memory under the heavy weight processesare known as Threads in JAVA.Basically there are two ways in which we can make a threadBy directly implementing the runnable interface.By internally implementing the thread class in interface runnable and extending thread class. Multithreading Every part of a program is called a thread and every thread defines a separate path of execution.Java provides a building support for multithreading program. The multithreadedprogram contains two or more parts that execute concurrently.Priority of which thread will start working first is decided by a program named as Thread Scheduler which is a program of the Operating System. It gives the priority randomly.SynchronizationTo avoid the corruption of data we use the concept of synchronization in threads.When we manage a single object into multiple threads then the chance of dataCorruption arises and to avoid this we need the concept of synchronization.The keyword synchronized is applied on the function w here the variables areassigned values. Due to the concept of synchronization only one threadexecutes at a time.Input/Output blowStreams are nothing but a special type of buffer. In terms of JAVA streams are flow of bytes.Benefits of I/O StreamExecution time reduces.Performance Enhances.Network congestion chances reduces.We get bulk data at a time.Streams are divided into two typesHigh Level Stream crushed Level StreamHigh level stream cannot be used alone, whenever we want to use a high level stream we have to attribute it by a low level stream.Stream Byte Stream Character Stream Console Based Unicode Input Output Reader writer Stream Stream Byte Stream Input Stream Output StreamFileInputStream FileOutputStreamBufferedInputStream BufferedOutputStreamDataInputStream DataOutputStreamObjectInputStream ObjectOutputStreamByteArrayInputStream ByteArrayOutputStreamPipedInputStream PipedOutputStream8 Character Stream Reader WriterFile Reader File WriterBuffered Reader Buffered Writerimpo rt java.io.*class Demo0public static void main(String args)FileOutputStream fout=new FileOutputStream(a.txt)PrintStream ps=new PrintStream(fout)ps.println(hello)ps.println(hey)System.setOut(ps)System.out.println(m)This is a sample program of how to write a file by coding in JAVA.SerializationSerialization is the process using which we can convert an object into a stream. If we have to use an object only once and then we need to use the same object after a long time then we use the concept of serialization.Features of SerializationOnly the object of that class can persist which implements serializable interface.If the parent class implements serializable interface then there is no need for child class to implement serializable.In case of serialization transient data members cannot persist.In case of serialization static data members cannot persist.Only the non-static data members can persist.If we make any variable transient that means those variables are unwanted now and willget no memory in the HEAP inside the JVM.Serializable interface is a type of marker interface. Marker interface are those interfacewhich have no methods.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.