Total Pageviews

962,945

Sunday, March 31, 2019

FUNCTION OVERLOADING


AREA OF CIRCLE, RECTANGLE,TRIANGLE USING FUNCTION OVERLOADING


import java.util.Scanner;
import java.lang.*;
class area
                {
                                void f(int x)
                                {
                                                double y=22.0/7.0*x*x;
                                                System.out.println("area of circle="+y);
                                }
                                void f(int x,int y)
                                {
                                                int z=x*y;
                                                System.out.println("area of rectange="+z);
                                }
                                void f(int x,inty,int z)
                                {
                                                double s=(x+y+z)/2;
                                                double s1=s*(s-x)*(s-y)*(s-z);
                                                double s2=Math.sqrt(s1);
                                                System.out.println("area of triangle="+s2);
                                }
                }
class area1
                {
                                public static void main(String args[])
                                                {
                                                                area ob=new area();
                                                                ob.f(7); // circle
                                                                ob.f(4,5); // rectangle
                                                                ob.f(3,4,5); // triangle
                                                }
                }
                               

Output:E:\>javac area1.java

E:\>java area1
area of circle=154.0
area of rectangle=20
area of triangle=6.0

E:\>

CONSTRUCTOR OVERLOADING IN JAVA

1. CONSTRUCTOR OVERLOADING WITHOUT PARAMETER, SINGLE PARAMETER, MULTIPLE PARAMETER - LINK

FUNCTION OVERLOADING IN JAVA

1. AREA OF CIRCLE, RECTANGLE,TRIANGLE USING FUNCTION OVERLOADING- LINK

Input three numbers using constructor and print the largest

Input three numbers using constructor and print the largest:                                                        





Area of Rectangle (CORE JAVA)

 Area of Rectangle:                                                                                                                              EDITED BY- SAYANI



import java.util.Scanner;
class rect
                {
                                int l,b;
                                void input()
                                                {
                                                                Scanner n=new Scanner(System.in);
                                                                l=n.nextInt();
                                                                b=n.nextInt();
                                                }
                                void output()
                                                {
                                                                System.out.println("area="+l*b);
                                                }
                }
class rect1
                {
                                public static void main(String args[])
                                {
                                                cl ob=new cl();
                                                ob.input();
                                                ob.output();
                                }
                }


Output:
E:\>javac rect1.java

E:\>java rect1
2
5
Area=10

E:\>

JAVA BASIC PROGRAMMING CODE


1. AREA OF RECTANGLE -   link
2. Input three numbers using constructor and print the largest- LINK
3. Roots of equation - link
4. 

UGC CBCS ASSIGNMENT R PROGRAM


UGC CBCS ASSIGNMENT PYTHON LAB


UGC CBCS ASSIGNMENT IMAGE PROCESSING LAB


UGC CBCS ASSIGNMENT BIG DATA LAB


UGC CBCS ASSIGNMENT CLOUD COMPUTING LAB


UGC CBCS ASSIGNMENT DATA MINING LAB


UGC CBCS ASSIGNMENT ASSEMBLY LANGUAGE LAB


UGC CBCS ASSIGNMENT COMPUTER GRAPHICS LAB


UGC CBCS ASSIGNMENT ARTIFICIAL INTELLIGENCE LAB


UGC CBCS ASSIGNMENT INTERNET TECHNOLOGY LAB


UGC CBCS ASSIGNMENT SOFWARE ENGINEERING LAB


UGC CBCS ASSIGNMENT DESIGN AND ANALYSIS OF ALGORITHM


UGC CBCS ASSIGNMENT DBMS


UGC CBCS ASSIGNMENT NETWORKING