Home Discussion Discuss: Java call method from another class

  • javaMagnus Manson October 7, 2011 at 10:54 AM

    I would like to call diffrent classes from one class. Inside one class if vag = 1 call class (name1), elseif vag = 2 call class (name2). How do I do this?

  • Thank youMo October 28, 2011 at 3:05 AM

    Not exactly what i was looking for but it helps so thanks.

  • Method callingEdward December 5, 2011 at 3:42 PM

    i have a question: write a java OOP that variables can hold hourly rate and number of hours worked display your gross pay (hourly & hours worked ) your Withholding tax which is 15% of your gross pay and your netpay Sample output: Hourly rate: 104.65 Hours work: 22 Grosspay: 2,302.3 Withholding tax: 345.345 Netpay: 1956.955

  • Thanks !!Rais January 7, 2012 at 3:13 PM

    Thanks, this helped a lot. It was very easy to understand.

  • His good but had codingXimalog March 15, 2012 at 1:38 PM

    Why don't we make room for inputting any values for int and int b using eg swing or reading in from cmd.thanks

  • Time problemsQafqaz April 3, 2012 at 1:57 AM

    I have a question. For example i have two same methods, but one of them in other class , and other one is my class. I call both of them but first one take more times to return any value. My question what is difference between the class? And why first one take more time than second one?

  • ThanksMagnus April 21, 2012 at 8:14 PM

    Thank you so much! I've been trying to get sound files to play in my game and this helped me call the sound method. :) Thanks!

  • call methodRozhan May 13, 2012 at 1:44 AM

    in this ex:CallingMethod{ I con't find error 25,27-32{S.o.p....}, pleas help to understand Method..

  • ULOLpakyow September 11, 2012 at 5:24 PM

    eh tang ina mo gusto mo 1v1 tayo sa programming?

  • Thank you !Cedric November 21, 2013 at 8:23 PM

    Thank you ! I'm a beginner and this example helps me to undestrand how to call method in other class ^^

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java Beginners

How to call the run method from another class?
How to call the run method from another class?  Sorry, if this is a stupid question. I would like to find out how to call the run method... run() { new FereastraPrincipala().setVisible(true); from the class 

General

Java call method from another class
Java call method from another class   ...; methods of another class. For this we have created two java files..., multiply, division and modulus have been created inside the class CallingMethod 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends class A { static method() } class C { } //how to access static method() from B to C 

Java Beginners

Call an array from multiple functions
Call an array from multiple functions  I am having two methods in this method i am getting array values from another class. i create same array name for accessing the method values(array) but it will access only one method values 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Interview Questions

how to call static method
how to call static method  class A { //some code } class B extends A { static method() } class C { } //how to access static method() from B to C 

Java Beginners

Use varibles from another class
Use varibles from another class  **I have two classes. class 1:** public class askfigures extends JFrame { method from class1: public void... in another class. another class: public class Askvalues extends JFrame 

Java Beginners

how to pass a string from one class to another
string from one class to another. import java.util.*; class A{ static String... String from class A: "+b); } }   Here is another example of passing string from one class to another. import java.io.*; class Class1 { public 

Java Beginners

javascript call action class method instruts
javascript call action class method instruts  in struts2 onchange event call a method in Actionclass with selected value as parameter how can i do 

Swing AWT

how to open one Jframe from main method call
how to open one Jframe from main method call  I have downloaded a snake game project in java. Initially the project contains three java files i.e... the main() method, when i run this Engine.java class game starts running 

Java Beginners

How to pass variable from one class to another in java
How to pass variable from one class to another in java  How to pass variable from one class to another in java?   Example: public class...; } } //Another class Class2. public class Class2 { public static void main(String 

JavaScript Questions

Calling java class method from javascript
Calling java class method from javascript  I want to call a java class method from javascript. The java class method is like "public String[] getWord()". I want to assign this string array value to a variable in javascript. I 

J2EE

Calling another web resources
or call any method. Passing control to the another web component Transferring... component call to another web resources. There can another web resources be called... a request to another resource. To call a resource it should be available on server 

Java Beginners

ArrayList as an argument to another class
ArrayList as an argument to another class  how do you pass arraylists as arguments to another class, and how does the method/class accept this arraylist for use 

Apache Velocity

Call class methods
Call class methods       This Example shows you how to call class method in velocity...: Use put() method of Class VelocityContext through object 'ctx'. 4: Create 

JSP Servlet Questions

Unable to call .jrxml file from jsp
Unable to call .jrxml file from jsp  Hi, I am doing web application... plugin. After creating report in netbean when i call that jrxml file...()) { rsOfIncident =db1.getExecute("Select * from Incident 

JavaMail Questions

call from java - JavaMail
call from java  Hi, how i will call servlet from java.. plz its... the java.net package to call a servlet from the java code...*; public class ServletExample extends HttpServlet { protected void service 

Ajax Questions

getting null value in action from ajax call
="linkStudentRegister" method="populateOne" class="bharat.RegistrationAction">...getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need 

Ajax Questions

getting null value in action from ajax call
="linkStudentRegister" method="populateOne" class="bharat.RegistrationAction">...getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need 

Ajax Questions

getting null value in action from ajax call
="linkStudentRegister" method="populateOne" class="bharat.RegistrationAction">...getting null value in action from ajax call  Getting null value from ajax call in action (FirstList.java)... first list is loading correctly. Need 

General

Hooking into the shutdown call - tutorial
Hooking into the shutdown call 2001-02-28 The Java Specialists' Newsletter... the Cape Town Java User Group gave me one solution and I found another solution...)? Until next week Heinz This material from The Java(tm 

Java Technology Tutorials

Class
and Perimeter of the square and another class is rectangle which is using for getting.... Constructor is the method which name is same to the class. But there are many difference... is using two classes. First class is another and second is the main class which 

Java Beginners

call frame - Java Beginners
call frame   dear java, I want to ask something about call frame to another frame and back to first frame. I have FrameA and FrameB. In frameA...(browse) then view FrameB. In FrameB i fill JTextfield1(FrameB) with "JAVA 

Java Beginners

get the value from another class - Java Beginners
get the value from another class  Hello to all, I have stupid question. I have main.java and ConfigXML.java(read my config xml file). Code from...)).getNodeValue().trim(); from my ConfigXML.java in main.java. Sorry for my bad 

General

Use of Local Inner class
;  The Java language enables you to define a class inside another... of method. Understand with Example The Tutorial illustrates an example from Local Inner class. The code include a Outer class Inner class include a method that add 

JSP Servlet Questions

How to make a servlet to automatically call another servlet at some time instant.
How to make a servlet to automatically call another servlet at some time instant.  Can some one assist me How to make a servlet to automatically call another servlet at some time instant. currently I have a single servlet which 

Java Beginners

how to pass class variable to another class
how to pass class variable to another class  i need to access a variable from a class to another class currently running at the same time. using... the following code: import java.util.*; class A { static int regd; static int 

DMCA.com