Home Answers Viewqa Java-Beginners plz explain me the output of program

 
 


sachin
plz explain me the output of program
1 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners

View Answers

August 22, 2009 at 4:24 PM


Hi Friend,

Output of this program is:

a=2
b=0
c=0
mul=27
volume=18

Three integer variables(a,b,c) and three methods have been defined in ThisDemo.java class.

The method show() of void type contains three parameters a,b,c.Through 'this' keyword,you can refer to any member of the current object from within an instance method. In this method, this.a is used to refer to the class field a.This value is then passed to the method variable 'a'by using this.a=a.When show() method is called with the values(2,2,2),it will display the values of b and c 0 as this keyword is not used to refer the class variables b and c.

The method show() with single parameter makes the values of class variable a,b and c equal by equalizing all the class fields with its variable.When this method is called with parameter value 3, it will display the product of three numbers i.e, 3*3*3=27.

The method volume() returns the product of three variables.When this method is called,it takes the value 2,3,3 of a,b,c respectively and shows the volume 18.

Thanks









Related Pages:
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line...;Hi Friend, Output of this program is: a=2 b=0 c=0 mul=27 volume=18
output
of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when... help me with the code, the program is given below.Thank you! import java.util.
plz help me today plz plz - Java Interview Questions
plz help me today plz plz  2.) Suppose list is an array of six....) What is the output of the following program? . public class exercise6...]); } } } } Output of above code is: 2 6 10 Explanation-In the above code, firstly
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
Plz help me with this Question - Java Beginners
Plz help me with this Question  this is java code... 2.2. Also explain how the code arrived at the results in b, bl, b2, and b3.  ... following output: false false true false Thanks
plz Help me find the correct programs answers
plz Help me find the correct programs answers   Create a washing... INDICA" and "TATA NANO" respectively. Plz mail me your answers... and loading capacity. Display the updated truck details. Write a program which
Plz Help Me
Plz Help Me  Write a program for traffic light tool to manage time giving between Main-Street and sub-Street. firstly, give green light for 40...? Program must be written in Micro C.   Here is a code that displays
I didn't gat an output for this code, plz send me a correct code
I didn't gat an output for this code, plz send me a correct code  Hi, Here is my code: import java.awt.event.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.*; import java.sql.*; public
Plz give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find... Abracadabra, 2 Abracadabra, 3 Abracadabra, 4 Output a b r null
plz help me any one as fast as u can
plz help me any one as fast as u can  A thief Muthhooswamy planned... element is (1<=i<=1000) Output Specifications Your program should... is given in an array. Write a program to find out the total number of jumps he
explain this method
(); } plz help me...explain this method   i hope any one can explain this method ` private void showMonth(int m, int y) { int lead_spaces = 0; if (m
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
can u plz explain the http request methods - JSP-Servlet
can u plz explain the http request methods  can u plz explain http... that we have deleted. Here is the explanation with the query : To explain use we...'); select * from users; Output
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........  import java.util.Scanner; class Even { static int getEven(int...') //this line cause an exception break; } } } output
Plz Help
Plz Help  Hello Guys!! Plz. Help I need to write a program to display the astrological sign based on your birthday for example If we enter the date... the output as ?LEO
plz plz plz inform me as soon as possible
plz plz plz inform me as soon as possible  ``by using c programs how to type
Help me
Help me  plz i want code of program to add real numbers and magic numbers in java example this input :- 5+3i-2+3i output:- 3+6i
help me plz - Java Interview Questions
help me plz  1)write a java program that prompts the user to input... scors on three exams and two large projects.the program should then add five...? plz answer my question   Hi Friend, Try the following code: 1
Help Me With This Plz - Java Interview Questions
Help Me With This Plz  Write a program that's print a word like(I S E) on the black screen with 0,1 only by using two dimensional array? the 1's will represent the words
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
plz help me - Java Interview Questions
plz help me  1)Rewrite the method in exercise 10 such that it use the binary search algorithm instead. the linear search algorithm is suitable... , the temporary peg. Your method should output the precise sequence of peg to peg disk
java, plz help me in doing this - Java Beginners
java, plz help me in doing this  # Write a small record management...=tf5.getText(); BufferedWriter output= new BufferedWriter(new FileWriter(f1..."); try{ BufferedWriter output= new BufferedWriter(new FileWriter(f3
help plz - Java Interview Questions
. the program than output the string in the reverse order . for exampele , if the input string is abcd, the output is : edcba plz plz plz plz plz help...help plz  1 )write a program that does the following : a. prompts
I/O Program output error
I/O Program output error  Hello All, I am working on a program that requries me to read and analyze a .txt file and output the results to a .txt file, but I am getting incorrect output. I have been successfull with part
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part... used for writes byte to output stream. It implements a buffered output
plz help me to write a snake game using swings - Swing AWT
plz help me to write a snake game using swings  write snake game program using swings
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss ...;  wow i got also same program. ok leave it. in this program they are passing........... the output should be how many dinosaur are alive more in a year. that's all
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
plz give me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
plz solve this program - Java Interview Questions
plz solve this program  write a program to out put this resault using two dimensional array this is an image of the reasult: http://www.4shared.com/file/154846107/dc2f1ac1/_2__Untitled-1.html so help me
output of the program
output of the program  public static int sum(List list) { int sum = 0; for ( Iterator iter = list.iterator(); iter.hasNext(); ) { int i = ((Integer)iter.next()).intValue(); sum += i; } return sum
plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 â?¤ 200; 3x1 + 5x2 â?¤ 150; 5x1 + 4x2 â?¥ 100; 8x1 + 4x2 â?­â?¥ 80, x1 â?¥ 0, x2 â?¥ 0
plz tell me
plz tell me  how to get no. of times the 'button' is pressed   Here is a java swing code that counts the number of times the button clicked... CountButtonClicks(); } JButton button1 = new JButton("Click Me!"); int clickCount
plz tell me the code & execution process - Java Beginners
plz tell me the code & execution process  Write a program to download a website from a given URL. It must download all the pages from that website. It should take the depth of retrieval from the user input. All the files/pages
How to get the output of jsp program using Bean
already did that one. Now i want the output of the program ,so please tell me...How to get the output of jsp program using Bean  Hello my Roseindia... the ouput.i want the output of the program .i posted the same program below so
plz tell me the code & execution process - Java Beginners
plz tell me the code & execution process  Write a program to download a website from a given URL. It must download all the pages from that website. It should take the depth of retrieval from the user input. All the files/pages
How to get the output of JSP program using Bean
want the output of the program ,so please tell me the Solution  Please...How to get the output of JSP program using Bean  Hi Kindly go through a simple program below and give the solution for the said below one
Plz Provide correct program code for all questions.
Plz Provide correct program code for all questions.   Write a program... of n numbers? Develop a program that accepts the area of a square and will calculate its perimeter. Develop the program calculateCylinderVolume., which accepts
Plz Plz reply Me - JSP-Servlet
Plz Plz reply Me  Respected Sir/madam, I am R.Ragavendran.. Actually I got your coding.. But This code is not enabling the user to click and change the image.. I request you to remember the code which you have provided for me
please explain this program
please explain this program  public class MainClass { public static void main(String[] args) { System.out.println("Java
plz help me - Java Beginners
plz help me  Deepak I can write a sessioon code plz help me admin_home.jsp page is display but data is not disply plz help me what is wrong