how to call one program .class file in another program
Answers were Sorted based on User's Feedback
Answer / surender
By creating instance of the .class file we can call it from any other program
| Is This Answer Correct ? | 27 Yes | 2 No |
Answer / divya
By creating instance of the .class file we can call it from
any other program.
| Is This Answer Correct ? | 16 Yes | 2 No |
Answer / amit
by making package we can include one call in other program
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / 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 |
Answer / kajalpreet kaur
by making an object of .class file,we can use it in other program.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rakesh
one answer in now proceeding after another file also use
the program
| Is This Answer Correct ? | 0 Yes | 0 No |
Can we create constructor in abstract class ?
Is java programming easy?
How does list work in java?
What is difference between static class and singleton pattern?
What do bitwise operators do?
What does opcode mean?
why the constructor should be used in class,if there is no constructor what will happen?
Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.
What is stringjoiner ?
what is tempplate pattern
Can a class extend more than one class?
What are selection structures?