[Solved] Arraylist for subclasses [duplicate]

I’m guessing it’s the line Program.setInventorie(c1);. You need to create an instance of the Program class and call setInventorie() on that. setInventorie() is not a static method. e.g.: Program myProgram = new Program(); myProgram.setInventorie(c1); 7 solved Arraylist for subclasses [duplicate]

[Solved] Custom List in java

I don’t understand as well what do you mean by “custom list”. But in your code, it seems you want to retrieve only the first and the last integer from the List. If you want to perform only this two operations, a Queue would be better than an ArrayList in term of performance. Obviously, if … Read more

[Solved] I run into trouble when i make my java Procedures to package,i do not know why? [closed]

From the picture you uploaded (please copy/paste the log here!), you have a missing column in your database, called insurance_dead_line. So you probably didn’t configure it your Liquibase changelog – did you create it with JHipster? Did you run mvn liquibase:diff? Or did you write your changelog manually? You have many options: I don’t know … Read more

[Solved] Read each input of the line in Java

In this case it’s highly recommended if you add some code that you tried! You have to follow the steps given below. Hope you would better understand if I don’t give you the code. 1) Create a scanner 2) Open the file 3) read the line 4) assign the read line into a string variable … Read more

[Solved] How to output java date format as 060115 [duplicate]

You can use java Calendar class to get everything about Time and Date: System.out.println(“0″+Calendar.getInstance().get(Calendar.DAY_OF_MONTH)+”0” + (Calendar.getInstance().get(Calendar.MONTH)+1) +”0″+ Calendar.getInstance().get(Calendar.YEAR)); Using String Format: import java.util.Calendar; public class PrintDate { public PrintDate(){ //Create this for later String year =String.valueOf(Calendar.getInstance().get(Calendar.YEAR)); //Keeping the year 2015 //Format the date to keep it in a single String String date = String.format(“0%d0%d%d”, Calendar.getInstance().get(Calendar.DAY_OF_MONTH), … Read more

[Solved] how to return the number of days according on its month using java [duplicate]

The below code uses the java Calendar class by setting it’s month to the input month and getting its max date by getActualMaximum() method. Also it will return 29 for leap years. public static void main(String args[]){ int month = 6; Calendar cal = Calendar.getInstance(); cal.set(Calendar.MONTH, month-1); System.out.println(cal.getActualMaximum(Calendar.DATE)); } 3 solved how to return the … Read more

[Solved] How to use .join() with Thread at this particular Thread

Assume you’ve created a class for your Thread like Thread myThread = new Thread(new Runnable(…)); myThread.start(); you can wait for this thread to finish by adding the line myThread.join() as last line of yout while loop. This will cause the main-thread to wait for myThread to finish before it continues. So your code would look … Read more

[Solved] How can I create a SIP connecton using Liblinphone interface class?

Absolutely an interface cannot be initialized. Because it has no method implementation. It’s not a class! I should use classes that implement these methods. In fact I should use org.linphone.core (Library) instead of LinphoneCore (Intreface) solved How can I create a SIP connecton using Liblinphone interface class?