• Register

Recent questions tagged public

0 votes
1 answer 5 views
Problem: The code is public class Multiply { public static Double multiply(Double a, Double b) { return a * b } } I cannot solve the above code. I tried a few things, like public class Multiply { public double multiply(double a, double b) { return a * b;} }
asked Feb 22 Ali 5.4k points
0 votes
1 answer 12 views
Problem: This is more a FYI: When initiating a new Project and implementing your Readme step by step I got this issue: /MainActivity.java:34: error: onNewIntent(Intent) in MainActivity cannot override onNewIntent(Intent) in ReactActivity protected void onNewIntent(Intent intent){ ^ attempting to assign weaker access privileges; was public 1 error :app:compileDebugJavaWithJavac FAILED
asked Feb 15 Ali 5.4k points
0 votes
1 answer 15 views
Problem: I am trying to write a program, but I'm getting this compiler error: Main.java:1: error: class WeatherArray is public, should be declared in a file named WeatherArray.java public class WeatherArray { ^ 1 error I have checked my file names, and my public class is the ... How can I fix this? Here is my code: public class WeatherArray { public static void main(String[] args) { // ... } }
asked Feb 15 Ali 5.4k points
0 votes
1 answer 44 views
Problem: Hi there! I have been learning to program for a long time now and I recently learned inheritance in Java. I wrote the following program for practice: class Institutions { public void print_institutions() { System.out.println("This is an institution"); } } class ... , I have no idea what is causing this error. Can anybody here please clarify the cause of the error and its solution? Thanks!
asked Dec 29, 2020 Code Learner 6.2k points
To see more, click for the full list of questions or popular tags.