GUVI
Back

compiling error this program how to solve this error please explain how to write a class file in java Assignment code editor

Created 2 years ago
39 Views
1 Comments
KarthicTfUN4x
@KarthicTfUN4x
KarthicTfUN4x
@KarthicTfUN4xProfile is locked. Login
>>> Compiling your code
Output:
>>> Main.java:3: error: class hello is public, should be declared in a file named hello.java
 public class hello{
        ^
1 error

Compilation Error


-------------------------------------------------------------------------------------
package hello.main;
public class hello{
  public static void main(String[] args){
    int a;
    int b;
   
    System.out.println((a+b)+" "+(a-b)+" "+a*b+" "+b/a+" "+b%a+" "+b++ +" "+b);
    
        System.out.println(a&b);
	    System.out.println(a|b);
	    System.out.println(a^b);
	    System.out.println(~a);
	    System.out.println(a<<2);
	    System.out.println(a>>2);
	    System.out.println(a>>>2);
	    System.out.println((a>b)&&(a==b));
	    System.out.println((a>b)||(a==b));
	    System.out.println(!((a>b)&&(a==b)));
                   }
                   }
      ------------------------------------------------------------------------------
Comments
Please login to comment.
 
Powered by habitate.io Habitate