Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone do python to java conversions?
#1
chr()

len()

ord()

list()

n = []

n.append

Thanks for any conversions you can make. I'll keep looking through http://java.sun.com/javase/6/docs/api/
Reply
#2
Solved one:
n=[]
in java is:
char data[] = {}
Reply
#3
I dont understand what those methods/functions in Python do. I can however convert them if i know their task. What do these do;
Code:
chr()

len()

ord()

list()

And I know the append() method. Are you trying to append text through a GUI or just through the use of writing to something?
My SMF Modifications:
http://anthony.vibrantvps.com/smf
Reply
#4
(12-01-2009, 02:05 PM)Project Evolution Wrote: I dont understand what those methods/functions in Python do. I can however convert them if i know their task. What do these do;
Code:
chr()

len()

ord()

list()

And I know the append() method. Are you trying to append text through a GUI or just through the use of writing to something?

Just through the use of writing something.
I also find len() it is String.length()
as for chr and ord
chr(97)
outputs a. I believe its hex
and ord('a') outputs 97, Its the opposite of chr
Reply
#5
Quote:String buffers are used by the compiler to implement the binary string concatenation operator +. For example, the code:


x = "a" + 4 + "c"
is compiled to the equivalent of:


x = new StringBuffer().append("a").append(4).append("c")
.toString()

StringBuffer Class
http://java.sun.com/j2se/1.3/docs/api/ja...uffer.html

append(String str)
http://java.sun.com/j2se/1.3/docs/api/ja...ng.String)

Understand?
Also, if your thinking of appending text to lets say a .txt file, use Java's write() method located in I/O.
My SMF Modifications:
http://anthony.vibrantvps.com/smf
Reply
#6
(12-01-2009, 07:34 PM)Project Evolution Wrote: StringBuffer Class
http://java.sun.com/j2se/1.3/docs/api/ja...uffer.html

append(String str)
http://java.sun.com/j2se/1.3/docs/api/ja...ng.String)

Understand?
Also, if your thinking of appending text to lets say a .txt file, use Java's write() method located in I/O.

Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why java haphazard 8 1,514 12-12-2011, 03:23 AM
Last Post: RDCA
  Need Java help from java expert. Blazin 2 1,931 09-07-2011, 02:43 PM
Last Post: AceInfinity
  dilemma: java or python Treblez 10 2,393 04-09-2010, 11:12 PM
Last Post: nevets04
  Java help php 1 842 04-06-2010, 06:41 AM
Last Post: php
  Java Problem for real java programmer Testgamma1 10 4,549 03-14-2010, 09:08 AM
Last Post: uber1337

Forum Jump:


Users browsing this thread: 1 Guest(s)