Sailor wa
Sailor wa

Reputation: 9

I am trying to run the below mentioned code but getting an error

package com.complete.reference;

public class shift {
        public static void main(String args[]) {
            byte a = 64, b;
            int i;
            i = a << 2;
            b = (byte) (a << 2);
            System.out.println("Original value of a: " + a);
            System.out.println("i and b: " + i + " " + b);
      }
}

Error: Main method not found in class com.complete.reference.shift, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application

Upvotes: 0

Views: 171

Answers (1)

Deepesh kumar Gupta
Deepesh kumar Gupta

Reputation: 896

Your code is fine try to write class name in capital letter otherwise it's okay, The possible error can be the way how you have added your external jars, Try to fix the libraries problems in Java Build Path.

Upvotes: 0

Related Questions