0

How to avoid time limit exceeding because of this error I cannot execute my program.

In java

11th Aug 2019, 1:06 PM
Ajeet Kumar Srivastava
Ajeet Kumar Srivastava - avatar
7 odpowiedzi
+ 1
your not calling your method ... you have to add a main method, which calls your method.
11th Aug 2019, 2:51 PM
Anton Böhler
Anton Böhler - avatar
+ 10
After seeing your code you dont have to creat main method.call your method inside a mean method like this public class BitWiseOperatorsDemo { static void bitwiseWithBoolean() { boolean a= true,b= false,c; c=a & b; System.out.println(c); c=a | b; System.out.println(c); c=a ^ b; System.out.println(c); } public static void main(String args[]) { bitwiseWithBoolean(); } } Note Java programme start with main method if you create a method and if you dont call that method from main than that method cannot be executed.
11th Aug 2019, 1:57 PM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 2
your program is probably not efficient enougth or you have an infinite loop inside of it... post your code here, so we can actually help you 😅
11th Aug 2019, 1:10 PM
Anton Böhler
Anton Böhler - avatar
11th Aug 2019, 1:19 PM
Ajeet Kumar Srivastava
Ajeet Kumar Srivastava - avatar
0
Please tell me briefly
11th Aug 2019, 2:06 PM
Ajeet Kumar Srivastava
Ajeet Kumar Srivastava - avatar
0
https://www.sololearn.com/learn/Java/2137/?ref=app Every java program needs a main method.
11th Aug 2019, 5:11 PM
Denise Roßberg
Denise Roßberg - avatar
0
Thank you everyone.
12th Aug 2019, 1:53 AM
Ajeet Kumar Srivastava
Ajeet Kumar Srivastava - avatar