944,144 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 396
  • Java RSS
Nov 4th, 2009
0

hey guys...can someone help me??

Expand Post »
well im thinking of making a program that can impress my instructors,,
can you suggest what program should i make??
and please assist me..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zrjamcrz is offline Offline
3 posts
since Jul 2009
Nov 4th, 2009
0
Re: hey guys...can someone help me??
Haha. No details? If you want to impress someone you'll have to program something that is either extremely cool (which would involve coming up with your own idea) or program something that is above your skill level. I'd program something that isn't that difficult such as the client/server game that was recently posted here, but that is probably above your current skill level by a little bit. In addition, such a game demonstrates at least basic knowledge of important concepts. i.e. the idea is to implement some simple game using sockets. Obviously it'd be an interactive game where client and server are involved in some type of communication. For example, the client drags their mouse around on their JFrame window, and have the server draw circles (or some other shape) at whatever position the server is currently dragging.
Last edited by BestJewSinceJC; Nov 4th, 2009 at 3:03 am.
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Nov 4th, 2009
0
Re: hey guys...can someone help me??
Code a ILoveYou class , which will display love symbol is various color combination .
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006
Nov 4th, 2009
0
Re: hey guys...can someone help me??
Click to Expand / Collapse  Quote originally posted by ithelp ...
Code a ILoveYou class , which will display love symbol is various color combination .

Java Syntax (Toggle Plain Text)
  1. System.out.println("love symbol is various color combination .");

Done.
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Feb 10th, 2010
-2

code to impress ur instructor

Hey dude..
I'm ravi finished my b.tech this year and i'm from india hyderbad. I'm sending you a program which can impress your instructor. show this to him. And if you have any doubts call me on my mobile 09885565635

Arrays are first-class objects

Regardless of what type of array you’re working with, the array identifier is actually a handle to a true object that’s created on the heap. The heap object can be created either implicitly, as part of the array initialization syntax, or explicitly with a new expression. Part of the heap object (in fact, the only field or method you can access) is the read-only length member that tells you how many elements can be stored in that array object. The ‘ []’ syntax is the only other access that you have to the array object.

The following example shows the various ways that an array can be initialized, and how the array handles can be assigned to different array objects. It also shows that arrays of objects and arrays of primitives are almost identical in their use. The only difference is that arrays of objects hold handles while arrays of primitives hold the primitive values directly. (See page 97 if you have trouble executing this program.)

Java Syntax (Toggle Plain Text)
  1. //: ArraySize.java
  2. // Initialization & re-assignment of arrays
  3. package c08;
  4.  
  5. class Weeble {} // A small mythical creature
  6.  
  7. public class ArraySize {
  8. public static void main(String[] args) {
  9. // Arrays of objects:
  10. Weeble[] a; // Null handle
  11. Weeble[] b = new Weeble[5]; // Null handles
  12. Weeble[] c = new Weeble[4];
  13. for(int i = 0; i < c.length; i++)
  14. c[i] = new Weeble();
  15. Weeble[] d = {
  16. new Weeble(), new Weeble(), new Weeble()
  17. };
  18. // Compile error: variable a not initialized:
  19. //!System.out.println("a.length=" + a.length);
  20. System.out.println("b.length = " + b.length);
  21. // The handles inside the array are
  22. // automatically initialized to null:
  23. for(int i = 0; i < b.length; i++)
  24. System.out.println("b[" + i + "]=" + b[i]);
  25. System.out.println("c.length = " + c.length);
  26. System.out.println("d.length = " + d.length);
  27. a = d;
  28. System.out.println("a.length = " + a.length);
  29. // Java 1.1 initialization syntax:
  30. a = new Weeble[] {
  31. new Weeble(), new Weeble()
  32. };
  33. System.out.println("a.length = " + a.length);
  34.  
  35. // Arrays of primitives:
  36. int[] e; // Null handle
  37. int[] f = new int[5];
  38. int[] g = new int[4];
  39. for(int i = 0; i < g.length; i++)
  40. g[i] = i*i;
  41. int[] h = { 11, 47, 93 };
  42. // Compile error: variable e not initialized:
  43. //!System.out.println("e.length=" + e.length);
  44. System.out.println("f.length = " + f.length);
  45. // The primitives inside the array are
  46. // automatically initialized to zero:
  47. for(int i = 0; i < f.length; i++)
  48. System.out.println("f[" + i + "]=" + f[i]);
  49. System.out.println("g.length = " + g.length);
  50. System.out.println("h.length = " + h.length);
  51. e = h;
  52. System.out.println("e.length = " + e.length);
  53. // Java 1.1 initialization syntax:
  54. e = new int[] { 1, 2 };
  55. System.out.println("e.length = " + e.length);
  56. }
  57. } ///:~
Here’s the output from the program:

text Syntax (Toggle Plain Text)
  1. b.length = 5
  2. b[0]=null
  3. b[1]=null
  4. b[2]=null
  5. b[3]=null
  6. b[4]=null
  7. c.length = 4
  8. d.length = 3
  9. a.length = 3
  10. a.length = 2
  11. f.length = 5
  12. f[0]=0
  13. f[1]=0
  14. f[2]=0
  15. f[3]=0
  16. f[4]=0
  17. g.length = 4
  18. h.length = 3
  19. e.length = 3
  20. e.length = 2
Last edited by Nick Evan; Feb 10th, 2010 at 1:14 pm. Reason: Added code-tags
Reputation Points: 9
Solved Threads: 0
Newbie Poster
ravishing is offline Offline
1 posts
since Feb 2010
Feb 10th, 2010
2
Re: hey guys...can someone help me??
"Unnecessary crap no one asked you about and no one's impressed by."

I guess you forgot the title to your post.
Reputation Points: 485
Solved Threads: 89
Posting Shark
verruckt24 is offline Offline
944 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Problems with java.awt.print
Next Thread in Java Forum Timeline: Help with Java IDE





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC