Click here to Skip to main content
15,507,179 members
Home / Discussions / Java
   

Java

 
QuestionWhat is causing error in my merge sort java code? Pin
Vivek Halakatti3-Dec-21 6:20
Vivek Halakatti3-Dec-21 6:20 
AnswerRe: What is causing error in my merge sort java code? Pin
Richard MacCutchan3-Dec-21 7:09
mveRichard MacCutchan3-Dec-21 7:09 
QuestionWhat may be the error in this java ->merge sort code? Pin
Vivek Halakatti2-Dec-21 8:15
Vivek Halakatti2-Dec-21 8:15 
AnswerRe: What may be the error in this java ->merge sort code? Pin
Richard Deeming2-Dec-21 22:29
mveRichard Deeming2-Dec-21 22:29 
QuestionWhy am I getting an error concatenating a String in java 16? Pin
Toml61828-Nov-21 7:13
Toml61828-Nov-21 7:13 
AnswerRe: Why am I getting an error concatenating a String in java 16? Pin
Gerry Schmitz28-Nov-21 8:58
mveGerry Schmitz28-Nov-21 8:58 
QuestionRe: Why am I getting an error concatenating a String in java 16? Pin
Richard MacCutchan28-Nov-21 9:13
mveRichard MacCutchan28-Nov-21 9:13 
AnswerRe: Why am I getting an error concatenating a String in java 16? Pin
Toml61828-Nov-21 10:55
Toml61828-Nov-21 10:55 
Im trying to extract the date from the string, then do a date conversion, but Im not able to extract the date correctly.
UPDATE:
Ok, I resolved this myself using the java substring function instead of trying to extract one character at a time:

String sTest = "09/21/2021 and other junk on the line";
System.out.println("sTest= " + sTest);
String sDate = sTest.substring(0, 10);
System.out.println("sDate= " + sDate);

Date date1=new SimpleDateFormat("MM/dd/yyyy").parse(sDate);
System.out.println(sDate +"\t"+date1);

now gives the expected result:
sTest= 09/21/2021 and other junk on the line
sDate= 09/21/2021
09/21/2021 Tue Sep 21 00:00:00 EDT 2021

modified 28-Nov-21 19:11pm.

Questionhelp with 2d cellular automata in JavaSwing Pin
Suave6519-Nov-21 10:10
Suave6519-Nov-21 10:10 
QuestionRe: help with 2d cellular automata in JavaSwing Pin
Richard MacCutchan19-Nov-21 22:55
mveRichard MacCutchan19-Nov-21 22:55 
QuestionSending BufferedImage thought a socket Pin
Valentinor8-Oct-21 3:10
Valentinor8-Oct-21 3:10 
AnswerRe: Sending BufferedImage thought a socket Pin
jschell24-Oct-21 7:53
jschell24-Oct-21 7:53 
GeneralRe: Sending BufferedImage thought a socket Pin
Valentinor24-Oct-21 22:40
Valentinor24-Oct-21 22:40 
GeneralRe: Sending BufferedImage thought a socket Pin
jschell23-Dec-21 6:29
jschell23-Dec-21 6:29 
AnswerRe: Sending BufferedImage thought a socket Pin
Gerry Schmitz25-Oct-21 9:35
mveGerry Schmitz25-Oct-21 9:35 
AnswerRe: Sending BufferedImage thought a socket Pin
Joop Eggen 202125-Nov-21 7:15
Joop Eggen 202125-Nov-21 7:15 
QuestionJava Programming Challenge Pin
Purvesh Ptdr24-Sep-21 19:22
Purvesh Ptdr24-Sep-21 19:22 
QuestionRe: Java Programming Challenge Pin
Richard MacCutchan24-Sep-21 22:19
mveRichard MacCutchan24-Sep-21 22:19 
Questionjava jshell beanshell eval string Pin
Majid Karimi28-Aug-21 0:45
Majid Karimi28-Aug-21 0:45 
AnswerRe: java jshell beanshell eval string Pin
jschell5-Sep-21 9:55
jschell5-Sep-21 9:55 
QuestionDefault Casting a column to type using Hibernate Pin
ficevivu3-Aug-21 20:50
ficevivu3-Aug-21 20:50 
QuestionHow to make a scrolling background for a JPanel in java? Pin
Mr.Corona13-Jul-21 2:51
Mr.Corona13-Jul-21 2:51 
QuestionRe: How to make a scrolling background for a JPanel in java? Pin
Richard MacCutchan13-Jul-21 3:37
mveRichard MacCutchan13-Jul-21 3:37 
AnswerRe: How to make a scrolling background for a JPanel in java? Pin
Mr.Corona13-Jul-21 3:41
Mr.Corona13-Jul-21 3:41 
GeneralRe: How to make a scrolling background for a JPanel in java? Pin
Richard MacCutchan13-Jul-21 3:46
mveRichard MacCutchan13-Jul-21 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.