Java Queries Here..

bijay_ps

Broken In
can anyone tell me what is the most effective way of learning JAVA, I am reading Complete reference for it....... but there is alot of thing given inside it and due to which I get confuse sometime :-(
So suggest me something
 
Last edited:
OP
furious_gamer

furious_gamer

Excessive happiness
^^ Get Head First Java. A fun way to learn effective Java. Use Complete Reference once you are good enough at basics.

For your previous post, read this link... (Regd "this" keyword)

Java "this" Keyword - Java Forums

Simply, "this refers to current object on which method is executing".
 

Piyush

Lanaya
what the heck

yesterday the cost of java head first was 328/--
and today it is 413!!!!

should i wait for the prices to fall again?

seriously life is pain
 

047

Broken In
Hi all,

I am developing an application using Java Swing. I am stuck somewhere. I need to display a date in a textbox and that date is fetched from MsAccess table, i am able to display that date in textbox but the format is not which i want. Date displayed is in the form e.g "2011-12-25 00:00:00" but i want it to be as "25/12/2011". the date in the table is in form "25/12/2011" with date type.

If anyone know this please help me.
 
OP
furious_gamer

furious_gamer

Excessive happiness
Hi all,

I am developing an application using Java Swing. I am stuck somewhere. I need to display a date in a textbox and that date is fetched from MsAccess table, i am able to display that date in textbox but the format is not which i want. Date displayed is in the form e.g "2011-12-25 00:00:00" but i want it to be as "25/12/2011". the date in the table is in form "25/12/2011" with date type.

If anyone know this please help me.

Use SimpleDateFormat method to format the date as you wish.

like

SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat formateDB = new SimpleDateFormat("yyyy-MM-dd");
String your_date = "2011-12-25 00:00:00";
System.out.println(sdf.format(formateDB.parse(your_date)));

I am not sure about the above code, but IIRC it is what i did in exact same case.
 
There a number of IDE for development in Java SE. These include JCreator, BlueJ, NetBeans and various others. If you are a beginner then use BlueJ for its simplicity and if you can code to a fairly good amount then use JCreator. My personal preference is Notepad, and then compiling the files manually via the console.
 

prateek007391

In the zone
I have used Python a bit and there is a nice feature that you can easily control Strings like

Hello * 3 = HelloHelloHello

however how to do so in Java.

Plzz Help!!!
 

Liverpool_fan

Sami Hyypiä, LFC legend
I have used Python a bit and there is a nice feature that you can easily control Strings like

Hello * 3 = HelloHelloHello

however how to do so in Java.

Plzz Help!!!

Er just because you do it in Python, doesn't mean you can do it in Java. If you like Python and want to leverage its power in the Java Platform, check out Jython.

And I doubt that's even possible, because as far as my limited knowledge in Java, there's no operator overloading so that I could create a string like class and add the operator to it. And certainly you can't use strign literals with such an operator.
 

prateek007391

In the zone
Seems most of the problems are getting sorted out.

However Plzz any one tell me how to clear screen in Java

Right now I am learning to create simple Apps, working in CMD

so what syntax I can use to clear screen.
 

prateek007391

In the zone
I know its Cls to clear screen in CMD

What about in Java.

is there any command in Java so that it can clear the screen of command prompt.

Something like

import java.OS. something something
 

Garbage

God of Mistakes...
^^ Java don't directly have access to command promp AFAIK.
If you want to execute a system command you might want to check Java exec - execute system processes with Java ProcessBuilder and Process (part 1) | devdaily.com
 

deathwish

Are you dead yet?
I want to learn Java and have gotten down to it already. I would like to know which IDE to use. I downloaded Eclipse. Is that appropriate for my level or should I rather download something more basic?

I know C/C++ so the logic behind the programs isn't too difficult for me to grasp, if that is any help at all. :p
 

Liverpool_fan

Sami Hyypiä, LFC legend
Assuming that you are using Windows OS, then install Notepad++. And yeah make sure when you install JDK, configure the paths.
And then you can save your code in Notepad++ and use javac and java commands in your command prompt. The reason I recommend this is for better understanding of the classpath et al.
After a while, if you find these steps too long, use Geany, will have all ease of use of an IDE with simplicity of a text editor.
 
Top Bottom