Normal (Sequential) Processing
class Hi {
public void show() { |/ creating a method show()
for (int i = 1; i <= 5; i++) {
System. out-println("Hi");
}
}
class Hello {
public void show() { // creating a method show()
for (int i = 1; i < 5; i++) {
System.out.println("Hello");
}
}
public class Test { // Test main class where the program starts execution
public static void main(String args) {
Hi objl = new Hil); // creates an object of Hi
Hello obj2 = new Hello(); // creates an object of Hello
objl. show();
obj2.show() ;
}
}
Nora Hamad @nora_hamad
عضوة جديدة
يلزم عليك تسجيل الدخول أولًا لكتابة تعليق.
خليك أول من تشارك برأيها 💁🏻♀️