Write a program to handling an action event in java. Write a program for a Constructor in java. Write an Applet program to show different-different shapes in java. Leave a Reply Cancel reply Your email address will not be published. What's the problem with this PDF? Java programs, find all basic as well as complex Java programs with output and proper explanation making Print statements should output HTML tags 1! Basic Java Syntax Originals of slides PrimeFaces, Java programming using Java 8, for those new to Java , Run fr om Eclipse and it is simple to use packages.
Platform independence :. Compiled code of a program should be executed in any operating system, irrespective of the as in OS in which that code had been generated. This concept is known as platform independence. Note: In structured programming lang programs, the global variable play a vital role. But because of these global variables, there is data insecurity in the structured programming lang programs.
In this way data is unsecured. But this is not the actual reason. Assume that it is a project. Now if any upgradation is required, then the client i. Now we should note that it is not guaranteed that the programmers who developed this program will still be working with that company.
Hence this project falls into the hands of new programmers. Automatically it takes a lot of time to study. The project itself before upgrading it. It may not be surprising that the time required for writing the code to upgrade the project may be very less when compared to the time required for studying the project.
If the new programmer adds a new function to the existing code in the way of upgrading it, there is no guarantee that it will not affect the existing functions in the code. This is because of global variables. In this way, data insecurity is created. Three of the global variables may be used only by two functions. But in a structured prog. To avoid this problem, programmers have designed a way such that the variables and the functions which are associated with or operate on those variables are enclosed in a block and that bock is called a class and that class and that class is given a name, Just as a function is given a name.
Now the variables inside the block cannot be called as the local variable because they cannot be called as global variables because they are confined to a block and not global. Hence these variables are known as instance variables. Therefore a class is nothing but grouping data along with its functionalities. Encapsulations came into existence in order to provide security for the data present inside the program. Note 2: Any object oriental programming language file looks like a group of classes.
Everything is encapsulated. Nothing is outside the class. Java Programs Hello World. Area Of Circle Java Program. Area Of Triangle. Area Of Isosceles Triangle. Area Of Parallelogram. Area Of Equilateral Triangl e. Perimeter Of Circle. Perimeter Of Rectangle. Volume Of Cone Java Program. Volume Of Cylinder.
Volume Of Sphere. Curved Surface Area Of Cube. Total Surface Area Of Cylinder. Factorial Program In Java. Calculate Electricity Bill. Calculate Discount Of Product. Calculate Distance Between Two Points.