how to call one program .class file in another program

Answer Posted / sudarshan kumar

public class Hello{
int a=5;
void sum(){
int s=a+10;
System.out.print("\n sum :: "+s);
}
}

class Client{
public static void main(String x[]){
Hello h=new Hello()
h.sum();
}
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you write a java class that could be used both as an applet as well as an application?

701


When does an object becomes eligible for garbage collection in java?

808


What is stack class in java?

768


What is the meaning of variables in research?

765


What are the important features of Java 8 release?

799


What is pojo class in java?

723


What is the right data type to represent a price in java?

754


Is sizeof a keyword in java programming?

812


What is the biggest integer?

802


Which collection allows duplicate values in java?

736


What is meant by structural programming?

785


What is the difference between quicksort & mergesort? When should they be used? What is their running time?

832


How do you represent a space in regex java?

727


When a byte datatype is used?

1211


Define how objects are stored in java?

781