0
Help my code is wrong
error is no public class found
8 Answers
+ 4
it will be easier for us to understand your problem properly if you share the code
+ 1
where's the code?????????
+ 1
click on insert button here in the comment section (extreme Bottom left) and choose the code
+ 1
you have two classes here in the first class you are doing your operation part.
and in second class you have main method in which you are calling the methods of first class.
right??
If so; then compiler gets confused and Cannot recognise the class which containes the main method..
so make the second class public
as:
public class Implement
0
how do I share it?
import java.util.*; class GreatestOfThree { private int num1,num2,num3; public void accept() { Scanner scan=new Scaner(System.in); System.out.print("Enter the 3 numbers"); num1=scan.nextInt(); num2=scan.nextInt(); num3=scan.nextInt(); } public void check() { if(num1>num2&&um1>num3) { System.out.print(num1+"is the greatest"); } else if(num2>num1&&num2>num3) { System.out.print(num2+"is the greatest"); } else { System.out.print(num3+"is the greatest"); } } } class Implement { public static void main(String[]args) { GreatestOfThree co=new GreatestOfThree(); co.accept(); co.check(); } }
0
anyone on discord?? it will be easier there
0
ooh thanks