Question: Create class called LabOne with attribute x = 1 2 - Create object of the class LabOne called object 1 and print the value of

Create class called LabOne with attribute x=12- Create object of the class LabOne called object1 and print the value of attribute x3- Create another attribute called y=2 and object called object24- Print the value of both x and y using this format x=1,y=25- Use object1 to change the value of attribute x x=3. Using setter method.6- Declare y as constant by using final.Note that :In Java, when final keyword is used with a variable of primitive data types(int, float, .. etc), value of the variable cannot be changed.7- Create static method called staticMethod, add print statement Static.Call this method from main method.Note that: A static method can be called directly from the class, without having to create aninstance of the class.8- Create public method called publicMethod, add print statement Public.Call this method from main method.9- Create public method called name with String parameter s.Add print statement inside the method ("My name is "+ s)Call the method with your name from main method.10- Create constructor of the class LabOne and create new attribute z.Use constructor to set the value of z z=4.Print the value of z from the main method.11- Create static method called number that takes integer parameter x and return value.Call this method from main method.12- Create another class in the same file called LabOne2.Add method called sum that takes two integer and print the sum of it.Call the method from class LabOne.13- Create an abstract class called Vehicle which attributes V_ID and V_name. The class has methodcalled getName and another abstract method called getID.

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!