Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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



Advertisement
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
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
Advertisements
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
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 answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
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 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
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 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 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 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 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 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 - 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
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 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
please explain this program
please explain this program  public class MainClass { public static void main(String[] args) { System.out.println("Java
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
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
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
 

 

 

DMCA.com