Java Language Presentation PDF

Document Details

Indira Gandhi Government Engineering College, Sagar

Pragati Bisen

Tags

java programming computer science programming language

Summary

This presentation covers fundamental concepts of the Java programming language. Topics include variables, data types, operators, OOPs, inheritance, interfaces, and exception handling. The presentation is suitable for undergraduate-level computer science students.

Full Transcript

Indira gandhi govt. engineering collage,sagar (M.P.) Rajiv gandhi proudyogiki vishwavidyalaya,bhopal (M.P.) Internship PRESENTATION...

Indira gandhi govt. engineering collage,sagar (M.P.) Rajiv gandhi proudyogiki vishwavidyalaya,bhopal (M.P.) Internship PRESENTATION Topic :Web development Submitted to : PRESENTED by : pragati bisen MRS. KSHIPRA SONI MAM 0601IT201046 Mrs. Pragati rajput mam Branch – information technology BASIC SYNTAX OF JAVA:- JAVA VIRTUAL MACHINE(JVM) The function of Java Virtual Machine is to execute the bytecode produced by the compiler. Every Operating System has a different JVM but the output they produce after the execution of bytecode is the same across all the operating systems. This is why Java is known as a platform- independent language. JAVA FUNDAMENTALS VARIABLE - These are the data container that saves the data values during Java program execution. Every variable is assigned a data type that indicates the type and quantity of value it can hold. DATA TYPE - Data types specify the different sizes and values that can be stored in the variable. OPERATORS - Operators are symbols that perform operation on variables and values. Object Oriented Programming (OOPs)- OOPs refers to languages that uses objects in programming. OOPs aims to implement real-world entities. It’s aim is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function Class –It is a user defined blueprint from which objects are created. It represents the set of properties or methods that are common to all objects of one type. Object – The object is an instance of a class, have Behavior and state. It is a basic unit of OOP and represents the real life entities. Method: A method is a collection of statements that perform some specific task and return result to the caller. It allow us to reuse the code without retyping the code. Access Modifier: Defines access type of the method , variable and class i.e. from where it can be accessed in your application. INHERITANCE IN JAVA:- Inheritance is a mechanism wherein a new class is derived from an existing class. TYPES OF INHERITANCE On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical. In java programming, multiple and hybrid inheritance is supported through interface only. We will learn about interfaces later. SINGLE INHERITANCE - When a class inherits a single class, it is known as a single inheritance. MULTILEVEL INHERITANCE - When there is a chain of inheritance, it is known as multilevel inheritance. HIERARCHICAL INHERITANCE - When two or more classes inherits a single class, it is known as hierarchical inheritance. HYBRID INHERITANCE- Hybrid inheritance in Java is a combination of two or more types of inheritances. INTERFACE IN JAVA It is a blueprint of a class. It has static constant and abstract method. By default all the methods in interface are abstract. A class can implement multiple interfaces. Exception Handling It is one of the powerful mechanism to handle the runtime errors so that the normal flow of the application can be maintained. Exception is an abnormal condition. In Java, an exception is an event that disrupts the normal flow of the program. It is an object which is thrown at runtime. Java provides five keywords that are used to handle the exception – try, catch, throw , throws, final.

Use Quizgecko on...
Browser
Browser