Question: **JAVA **PLEASE INCLUDE THE **SCREENSHOT**OF THE RUNNING PROGRAM! PROGRAM: A) class Cycle{ private int numberOfWheels; private int weight; Cycle(int numberOfWheels,int weight){ this.numberOfWheels=numberOfWheels; this.weight=weight; } public

**JAVA **PLEASE INCLUDE THE **SCREENSHOT**OF THE RUNNING PROGRAM!

PROGRAM:

A)

class Cycle{ private int numberOfWheels; private int weight; Cycle(int numberOfWheels,int weight){ this.numberOfWheels=numberOfWheels; this.weight=weight; } public void print(){ System.out.println("Number Of wheels :"+numberOfWheels); System.out.println("Weight "+weight); } } public class CycleDriver{ public static void main(String args[]){ Cycle C1=new Cycle(2,10); C1.print(); } } OUTPUT:**JAVA **PLEASE INCLUDE THE **SCREENSHOT**OF THE RUNNING PROGRAM! PROGRAM: A) class Cycle{

B)

class Cycle{ private int numberOfWheels; private int weight; Cycle(){ this(100,1000); } Cycle(int numberOfWheels,int weight){ this.numberOfWheels=numberOfWheels; this.weight=weight; } public void print(){ System.out.println("Number Of wheels :"+numberOfWheels); System.out.println("Weight "+weight); } } public class CycleDriver2{ public static void main(String args[]){ Cycle C1=new Cycle(); C1.print(); } }

private int numberOfWheels; private int weight; Cycle(int numberOfWheels,int weight){ this.numberOfWheels=numberOfWheels; this.weight=weight; }

B programs javac cycle Driver -java B programs java Cycle Driver Number of wheels :2 height 10 B: programs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!