please help me fixed this java code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

please help me fixed this java code

import java.util.Scanner; class vehicle{ private String name; private int age; vehicle(String n, int a){ this.name=n; this.age=a; } public String getName(){ return name; } public int getAge(){ return age; } public void setName(String na){ this.name=na; } public void setAge(int aa){ this.age=aa; } public void setBoth(String nam, int agee){ this.name=nam; this.age=agee; } void vehicle1(){ System.out.println("name is " +name +" and your age is " +age +" years"); } void vehicle2(){ System.out.println("name is " + name +" age is unknown"); } void vehicle3(){ System.out.println("age is " +age +" name is unknown"); } } class single{ private String soth; single(String s){ this.soth=s; } public String getSoth(){ return soth; } public void setSoth(String s){ this.soth=s; } } class program { public static void main(String args[]){ System.out.println("ENTER YOUR NAME AND YOUR AGE TO CONTINUE"); Scanne

15th Dec 2021, 1:50 PM
Ibrahim Ahmad
Ibrahim Ahmad - avatar
1 Answer
16th Dec 2021, 9:32 AM
Ibrahim Ahmad
Ibrahim Ahmad - avatar