0

Help my code is wrong

error is no public class found

14th Dec 2017, 2:59 PM
[No Name]
[No Name] - avatar
8 Answers
+ 4
it will be easier for us to understand your problem properly if you share the code
14th Dec 2017, 3:03 PM
Md. Nafis Ul Haque Shifat
Md. Nafis Ul Haque Shifat - avatar
+ 1
where's the code?????????
14th Dec 2017, 3:02 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 1
click on insert button here in the comment section (extreme Bottom left) and choose the code
14th Dec 2017, 3:07 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 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
14th Dec 2017, 3:13 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
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(); } }
14th Dec 2017, 3:03 PM
[No Name]
[No Name] - avatar
0
anyone on discord?? it will be easier there
14th Dec 2017, 3:08 PM
[No Name]
[No Name] - avatar
0
ooh thanks
14th Dec 2017, 3:13 PM
[No Name]
[No Name] - avatar