Write a java program to calculate area of rectangle by passing and returning object as a parameter. Get link Facebook X Pinterest Email Other Apps - April 04, 2019 Source Code:- import java.io.*; class rect { rect(double n,double m) { double l,b,area; l=n; b=m; area=l*b; System.out.println("Area of Rectangle :"+area); } public static void main(String arg[] ) { new rect(10.0,20.0); } } Output :- Get link Facebook X Pinterest Email Other Apps Comments
Write a Java code to input height (in inches) and convert it into feet and inches. - April 04, 2019 Source Code:- import java.io.*; import java.util.*; class height { height() { int a,b,inch; Scanner s=new Scanner(System.in); System.out.println("Enter the Height in inches"); inch=s.nextInt(); a=inch/12; b=... Read more
Design an AWT application to calculate the factorial of a number. - April 04, 2019 Source Code:- import java.awt.*; import java.awt.event.*; class Factorial extends Frame implements ActionListener { TextField tf1,tf2; public Factorial() { setLayout(new FlowLayout()); Label lb1=new Label("Enter Number:"); Label lb2=new Label("Factorial is:"); tf1=new TextField(15); ... Read more
Comments
Post a Comment