Java programming Tips

@suryan (45)
India
December 21, 2006 11:59am CST
1)Do you know in java Programming when constructor are given return type then it acts as a normal function.And if static keyword is given before constructor then while compiling it ask for return type.If we give return type before static keyword then it acts like normal functions. 2)In every program we use public static void main but instead of that if we use public static void mian .That is instead of main we misspell as mian Do you know what will happen.Most of them will think it will not compile and execute.But this is not true.It will compile and generate error when it try to execute it.Reason is while it executes JVM start searching for main and as main is not present it generates error. 3)Anyone of you know How to find the size of object.And people will think as there is no sizeof operator in java we can't find.But this is not true.We can find the size of object with the class name Runtime.we have get the size by the using the code Runtime r = Runtime.getRuntime(); before and after the creation of the new objects you can check the memeory and by subtraction you can get the memory like sizeof operator in C. 4)how to write a Java application without a main method class MainMethodNot { static { System.out.println("Hello Java"); System.exit(0); } } As there is no main method you will think how the program will compile and execute.But it will do.When it find static keyword it enter in the loop and print Hello Java and before JVM find main method it there is exit command and it terminates before searching main. 5)Do you konw in JVM there are 3 things.First is class Loader.Second is class Verifier.Third is Java Interpreter.class Loader loads the dot class file(.class) which contains bytecode and byte code means it doesnot have one's and zero format rather than bytecode is in form of assembly language. class verifier checks for errors and java Interpreter converts machine independent code to machine dependent code.And when we try to execute with keyword java filename.the java invokes JVM and class Loader and the file is loaded in RAM. 6)If you think my Java Tips was useful and if you are intrested to learn more We can be a good friend and share more tips and information.I think this much information is good to for Today.I will give more such Tips afterwards.
3 people like this
22 responses
@amitavroy (4819)
• India
21 Dec 06
well i have a little bit of knowledge about java and the technology is rocking it saves a lot of loading time for your sites and also it put less pressure on the server becasue it is client side technology. i am thinking of learnig it. but you know what i am a designer who does the html part also and i m very good at it but i am not able to understand should i do java cause i dnt have any programming background. can any one advice me
@baknudz (241)
• Philippines
22 Dec 06
P.O.D. - While they play around with the infectious grooves of reggae and Latin music as well as the heavy deliverance of hip-hop and rock, San Diego's hard rock four-piece P.O.D. has defined a universal message. They're born-again Christians and their faith takes a central place in their music.Formed in 1992 in the SoCal neighborhood of San Ysidro, Marcos (guitar) and Wuv (drums) relished the music they grew up on. San Ysidro or "Southtown" was a multicultural area, but working class. While Marcos and Wuv were fond of their jazz and reggae roots, they were young punks in the making. Both loved the gnarl of grunge and took to liking Green Day, Pennywise, Bad Brains, and the Vandals. They got a band together, P.O.D. (short for "Payable on Death"), with Wuv's hip-hop MC cousin, Sonny, and aimed for something real. Cleveland native Traa joined in 1993 and P.O.D. were on the map.Throughout the 1990s, P.O.D. played countless shows across the nation and sold more than 40,000 copies of their three homemade EPs -- Brown, Snuff the Punk, and P.O.D. Live -- on their own Rescue Records. Atlantic Records was intrigued by the group's hard-working ethic and passion for music, inking a deal with P.O.D. in 1998. The Warriors EP preceded the major-label debut of P.O.D.'s 1999 release, The Fundamental Elements of Southtown. "Southtown" and "Rock the Party (Off the Hook)" were powerful singles, pushing the album to go platinum. P.O.D. earned top honors for Best Hard Rock or Metal Group, Album of the Year, and Song of the Year for "Rock the Party (Off the Hook)" at the 1999 San Diego Music Awards as well.A year later and with the buzz still going, P.O.D. hit the road with Ozzfest 2000 and shared dates with Crazy Town and Staind for the MTV Campus Invasion tour. They also ventured into films, contributing several songs to various soundtracks. "School of Hard Knocks" proved successful in the Adam Sandler comedy Little Nicky in 2001, whereas additional tracks featured in the Al Pacino sports thriller Any Given Sunday and Ready to Rumble maintained P.O.D.'s growing status. A second album for Atlantic, Satellite, was recorded with Howard Benson in spring 2001. Benson captured the magic once again, for P.O.D.'s stature exploded later that year, hot on the heels of the spiritual chaos of debut single "Alive." "Youth of the Nation" scored again for P.O.D., as its positive mix of hip-hop, reggae, and hardcore punk defined a different kind of rock next to the likes of Kid Rock, Limp Bizkit, and Korn.
hey any sideline there for HTML codings or designings? i'm just a beginner on web. Can you give me links to your accomplished sites? please!!!!
@ivbsav (193)
• Indonesia
22 Dec 06
hello everybody, I'm very glad join this topic. Actually I'm a programmer who develop a Java Programming for SMS. If you interested deeply. Please send me a PM. I will give you the URL because the terms of this services not permitted me to promote my URL. Good Job guys
@luolei (166)
22 Dec 06
i think it is a good idea
@luolei (166)
22 Dec 06
i think it is a good idea
@ravibabli (1557)
• India
22 Dec 06
I know that Java is language programing.
• India
22 Dec 06
thanks alot dude
@anup12 (4177)
• India
22 Dec 06
I would just add on to your first point although a constructor can have return type it is not retruning anything Refer the code below: class Example4 { void Example4() { System.out.println("Constructor can have return type"); } void display() { System.out.println("Empty"); } public static void main(String args[]) { Example4 e=new Example4(); e.display(); } } The System.out.rpitnln statements is not gettinmg executed in this program just check it
@calvin222 (1606)
• India
22 Dec 06
I have no idea about JAVA. what is it used for? is it difficult to learn? can i get a good job if i do?
• India
22 Dec 06
java - java
i dont know java
• Philippines
22 Dec 06
Nice tips from you. I really appreciate them. I haven't known about those tips until you said them . Thank you! Maybe, you are a Java expert already. Can you teach Java because I want to learn it more?
@deepakg4 (895)
• India
22 Dec 06
refer some books. or discuss with u r senior
@subbusa (106)
• India
22 Dec 06
Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. Java applications are, in the official implementation, compiled to bytecode, which is compiled to native machine code at runtime. in java v need the important tink named JAVA VIRTUEL MACHINE......java s a poratable language it can b used n any systems
@Nakisz0r (145)
• Brazil
22 Dec 06
omg, very good man!
@Leonzz (195)
• Brazil
22 Dec 06
Greats tips man. That a really cool begin. I likes Java and VB a lot!
@anup12 (4177)
• India
22 Dec 06
I am completely bowled over by your nice discussion I am myself a Java man I mean I like the Java language very much and I think u have amde a very good contribution please share some more
@jbdhiman (551)
• India
22 Dec 06
This is great
• India
22 Dec 06
ya this was a good discussion.am eager to know more ..i myself is a computer engineer but haven't started doing projects yet...so it will be kind of you if you share such tips
@essytssy (125)
• India
22 Dec 06
even though these are basic thing or concept that every programmer has 2 know...so i guess ur a good programmer...ll keep in touch..
@psyd_1 (469)
• Philippines
22 Dec 06
thanks for the tips man....
@ArturCR (19)
• Portugal
22 Dec 06
Really nice post. I read your steps and tips. I liked it. Keep working ;)