plz explain me the output of program

plz explain me the output of program

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 Tutorials/Questions & Answers:
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
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
Advertisements
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
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
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 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
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 plz plz inform me as soon as possible
plz plz plz inform me as soon as possible  ``by using c programs how to type
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 give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
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
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 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
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 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 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 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
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
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
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
plz help me - Java Beginners
plz help me  Hi, I want to search all field from database using name, and display in text box, then data is update and delete. i want to search name using alphabets a-z, plz reply fast. plz help me this is very urgent
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
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  Thanks deepak continue response..i face some problem i... is true...but i very confuse that how it is not displayed admin page plz any one give me reponse my persinal given id  Hi ragni, i am sending
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
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
program on helloworld :explain
program on helloworld :explain  class Hello { public static void main...; variable exists within the class or object. (instance of program is called object... in the Java program and java program can't run without main method. JVM calls the main
program on helloworld :explain
program on helloworld :explain  class Hello { public static void... the class or object. (instance of program is called object ). The public word...". The main Method: The main method is the entry point in the Java program and java
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 - Java Beginners
plz help me  deepak hw can i create a data grid in jsp and also how can i connect to the data base plz help me  to create data grid in jsp use html tables with borders. to connect to data base use scriptlets. ex
how the answer is 13 can anyone explain plz
how the answer is 13 can anyone explain plz  public class that { public static void main(String arr[]) { int i=3; int j=1; while(i<4) { //j=i; i=i+j/2; } System.out.println(i
Plz provide me all the material for Java
Plz provide me all the material for Java  Plz provide me all the material for Java   Please go through the following link: Java Tutorials
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
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 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
Intranet Website creation - plz help me
Intranet Website creation - plz help me   hi.. I have assign with the intranet website creation work..right from scratch to end..And honestly I know nothing about it.My domain is totally different .. can anybody pls help me
facing problem plz help me out - Framework
Facing problem plz help me out  hi i am new to servlet i deployed... the web.xml file too parallel to the classes folder now i am facing this problem.plz tell me what to do... error:The requested resource (Servlet servlet
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
Help me plz in Probablity distribution of Java
Help me plz in Probablity distribution of Java  Hello, I have an issue I have connected my JDBC driver with my database.. Now I want to randomly...% is insert or update queries. Which distribution to use and how to achieve it.. Plz
help me plz befor 27 februry
help me plz befor 27 februry  what is rung with this ?? help me plzzzz import java.util.Scanner; public class Initials { public static void main (String [] args) { String firstname,lastname
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 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
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

Ads