Results 1 to 20 of 23
Thread: Can help with java technologies
- 07-08-2009, 09:48 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
Can help with java technologies
Hi, community
I am experienced java (and other) developer with knowledge in spring, jboss, oracle and so on. I am certified in these subjects.
Know a lot about these words: Spring, Hibernate, JNDI, JMS, Servlets/JSP, Junit, GIT, svn, MS SQL, Oracle, PKI, UML, Design Patterns...hm, and many others
Long ago, when I came to java world, it was hard to find out, which framework to use, when use them and so on. I had a lot of questions about architecture and code design, code management, continuous integration...I know that a lot of developers have the same problems.
But I also have "problem" - not in development, but in communication. English is not my native language, although I use it for years...The problem is in speech practice. I read documentation, write documentation, write emails and forums and have almost none practice in speech. Another one problem is talk subjects: I do English only for software....
I suppose my idea is clear now.
If you are English speaking person, we can meet in skype and I will tell you a lot about java world (and those scary words from above). You will get great info, I will get practice ;)
If you are interested, let me know by email: softwaretalks@yahoo.com, with your skype ID
and I will contact you. I don't say I will contact you immediately - but I will!
thank you!
- 07-09-2009, 05:36 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Seems not a bad idea. I hope you'll find a lot here from our community. Good luck :)
- 07-10-2009, 05:53 PM #3
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
Hello Sir ,
As i m a beginner I have some queries with in basic of java J2se.i am basically confused in the rule of interface example if we want to create ab object of ArrayList......
ArrayList ar=new ArrayList(Collection c);
here c is the object(refrence variable) of Collection. then why it is possible to use or pass the objects(in below example object v) of other(like ArrayList,Vector,LinkedList etc) classes which is implementing the the Collection interface in this constructor
eg... Vector v=new Vector();
v.add("aaa");
v.add("bbb");
ArrayList ar=new ArrayList(v);
we can only use the Object of Collection interface then how can it be possible topass other classes objects it is not according to rule passing paramenters
i have also tried passing (interface)Enumeration object (refrence variable) in
Vector v=new Vector();
Enumeration e=v.elements();
SequenceInputestream in=new SequenceInputestream (e);
is correct but when i tried to pass the object of StringTokenizer(this class implements Enemuration interface same as Vector implements Collection Interface) it did't work
hope u know my query and will reply me
- 07-10-2009, 06:22 PM #4
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
Hi
the key is interface definitions: java has core interface Collection, and Collection has children List, Set and others
So ArrayList, Vector and other are concrete implementations of these interface
google for "is a" concept
Example:
ArrayList array = new ArrayList();
This is not optimal way of declaring variable: variable should be as generic as possible, to decrease coupling in your code
So right way is:
List array = new ArrayList();
Other example
You have:
new ArrayList(Collection c)
if you will create:
ArrayList arraylist = new ArrayList();
Vector vector = new Vector();
LinkedList linkedlist = new LinkedList();
and will check these obects with instanceof:
if (arraylist instanceof Collection) {
System.out.println("true");
}
if (vector instanceof Collection) {
System.out.println("true");
}
if (linkedlist instanceof Collection) {
System.out.println("true");
}
you will get 3 thues, as all these objects are collections
hope this helps
p.s.
my skype is 'softwaretalks'
- 07-10-2009, 09:58 PM #5
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
Hello sir,
Thanks a lot for your reply, i get fustrated when i dont get the solution of any problem even after a lot of research and development,as i am learning javaa alone nobody is helping me but today i found someone who will solve my queries thanx sir
i have tried and it also helped but i also tried one more thing, the program i tried is given below
import java.util.*;
import java.io.*;
class coltes
{
public static void main(String args[])
{
Vector v=new Vector();
if(v instanceof Vector)
{
System.out.println("true"); //it will print true
}
StringTokenizer st=new StringTokenizer("a b c d s"," ");
if(st instanceof Enumeration)
{
System.out.println("true");// it will print true
}
//SequenceInputStream sr=new SequenceInputStream(st); //error in this line cannot find constructor
}
}
its working fine but here is one error in this line
SequenceInputStream sr=new SequenceInputStream(st);// st is object of StringTokenizer
as you said Vector,ArrayList etc are concrete implementations of Collection interface
but its not working in the case of StringTokenizer when is used it in place of Enumeration
interface.
reply me when you will read this query
- 07-10-2009, 10:18 PM #6
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
google for "java 5 javadoc" and add that page to bookmarks
and this page contains information you need:
java.sun.com/j2se/1.5.0/docs/api/java/io/SequenceInputStream.html#SequenceInputStream
java 5 has generics for all collections: so your collection must contain InputStreams only
So this will compile:
Java Code:Enumeration<InputStream> fake = null; SequenceInputStream sr= new SequenceInputStream(fake);
Last edited by softwaretalks; 07-10-2009 at 10:31 PM.
-
softwaretalks welcome to our community! We're very glad to have you contributing. One tip that will make your code posts a little easier to read is to use code tags. They will help your code to retain its formatting. There are two ways to do this:
1) Highlight the code you've pasted and press the code button, or
2) Manually place the tag [code] above your code block and [/code] below your code block.
Hope to see more of you here, and hope this helps!
- 07-12-2009, 02:20 AM #8
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
Hello sir,
How are you?
I have just started the topic of thread and i have one query, i executed that below code its working fine but i have some confusion here in this code
thread.start();
why this line working because according to rule (inheritance) when we create the object of super class(Thread thread;) by giving the refrence (thread= new BasicThread1();) of Base class, We can only call or use those methods which are available in Base class and(thread.start();) this method is not available or overriden in base class then why its working fine...
Sir please send me any link or notes where more examples of thread are available by which my basic on this thread topic will become stronger
Java Code:// This class extends Thread class BasicThread1 extends Thread { // This method is called when the thread runs public void run() { System.out.println("this is BasicThread's run method."); } } class BasicThread2 { public static void main(String args[]) { // Create and start the thread Thread thread = new BasicThread1(); thread.start();// i did't get this line....... } }
-
Thread's start method will call the run method, and in this situation will call the inherited run method.
Having said that, you really shouldn't extend Thread here but instead should implement a Runnable.
- 07-12-2009, 11:28 AM #10
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
There are two methods to create new thread in java
1. extend Thread class
2. implement Runnable interface
Both cases require you to override run() (override or implement). But you should never call run directly, as this will execute all commands in the same thread.
start from Thread creates real thread and run "run()" in it
class BasicThread1 extends Thread
means BasicThread1 has all public, private and default methods of Thread
- 08-22-2009, 08:10 PM #11
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
How to put value in Servlet's HTML textbox?
Hello sir, I have one query of Servlet
Below is the code of welcome page which include 2 textbox in which user
Will put value1 and value2.
After clicking on the submit button this HTML page would be redirected to Servlet (Add.java). The code of Servlet Add is given belowJava Code:<html> <body> <form action="Add" method="get"> Value1 <input type="text" name="t1" /><br> Value2 <input type="text" name="t2" /><br> <input type="submit" name="b1" value="click" /> </form> </body> </html>
This Add servlet includes the code of addition of those two values which was given by the user in welcome page. My query is how can we put the value of int variable c (c=a+b;) in the textbox named textbox1? Or how can we give the value of any variable to the attribute (value) of textbox?Java Code:import java.io.*; import javax.servlet.*; public class Add extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); Int a=0,b=0,c=0; String st1=request.getParamater(“t1”); a =Integer.parseInt(st1); String st1=request.getParamater(“t2”); b =Integer.parseInt(st2); c=a+b; out.println(“<html><body><form>”); out.println(“Addition Result: <input type=\”text\” name=\”textbox1\” value=\”\”>”); out.println(“</html></body></form>”); } }
Thanks
Hope you will reply as soon as possible.
- 08-24-2009, 08:53 PM #12
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
Hello
First of all you can just write string + int + string, this will print html as you need.
But it is not a good idea to mix presentation code (html) with business code (servet)
You should add view jsp and use JSTL (very simple set of tags to work with UI)
Take a look at spring mvc - they have good samples
- 08-25-2009, 09:39 PM #13
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
put value in to Textbox (Servlet)
Thanks for your relpy sir
i am a beginner in J2ee, i just started with Servlet and most of the topic(JSP etc) and frame work are left to learn. you wrote "write string + int + string, this will print html as you need." i did't get it, could you give an example for it.
My query is like with the help of request.getParameter we retrive the data of textbox lie this i want to insert the data in text box
Kindly huid me for this
Thanks
- 08-28-2009, 01:43 PM #14
Member
- Join Date
- Jul 2009
- Posts
- 6
- Rep Power
- 0
just add string to value
....value = \" + request.getParameter("text") + "\" >"...
- 08-28-2009, 02:00 PM #15
Hi softwaretalks,
Welcome to our forum!!!!!!!!!!!!!! Being an experienced professional,I hope you will be an inspiration to emerging Java developers!
-Regards
RamyaRamya:cool:
- 08-28-2009, 02:50 PM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
- 09-03-2009, 11:08 PM #17
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
java basic print integer variable
Hello Sir
i am bit confuse when i am printing integer variable is printing somthing else
example given below:
kindly solve my queryJava Code:class integer { public static void main(String args[]) { int i= 010; System.out.println("i="+i); //its printing 8 but it should print 10 int a=0x10; System.out.println("a="+a); //its printing 16 } }
thanks
- 09-04-2009, 01:49 AM #18
Member
- Join Date
- Aug 2009
- Posts
- 25
- Rep Power
- 0
Hi there, i have sent you an email with my skype account info.
I am not a native english speaker either, but my written and spoken english is pretty good.
So if you are interested just let me know.
My java experience is based on school projects and lessons.
I mastered the basics, and i am familiar with jdbc and swing aswell=)
hope to hear from you soon, greetz.
- 09-04-2009, 09:11 AM #19
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
- 09-05-2009, 10:28 PM #20
Member
- Join Date
- Jul 2009
- Posts
- 9
- Rep Power
- 0
Hello steelshark
Hello steelshark,
I just read your post, i am very much intreasted in learning Java techonology.
As u said u have sent me an email regarding skype account info, i did't get any such email i am going to check it again.
I am really thankful to you (softwaretalks,Tolls) , all other members and owner of the java-forums who are helping not only me, many other folks also who getting difficulties in learning java.
hope you will reply
Thanks
Similar Threads
-
Embedded Java Middleware in STB Technologies
By neel_vk in forum Jobs OfferedReplies: 1Last Post: 08-11-2009, 03:46 PM -
JAX India 2009: International Conference on Java Technologies April 06-10, Bangalore,
By ash1 in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 03-16-2009, 10:01 AM -
JAX India 2009: International Conference on Java Technologies April 06-10, Bangalore,
By ash1 in forum Java SoftwareReplies: 0Last Post: 03-13-2009, 10:13 AM -
I need some serious help with Java technologies...Please can someone help me!
By docklad1 in forum New To JavaReplies: 3Last Post: 02-13-2009, 04:34 PM -
JAX India 2009: International Conference on Java Technologies April 06-10, Bangalore,
By ash1 in forum CLDC and MIDPReplies: 0Last Post: 01-28-2009, 06:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks