Drag and drop from the options below to create an object of the A class in the B class and call its "test" method. public A { | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Drag and drop from the options below to create an object of the A class in the B class and call its "test" method. public A {

Drag and drop from the options below to create an object of the A class in the B class and call its "test" method. public A { public void test() { System.out.println("Hi"); } } class B { public static void main(String args[ ]) { obj = A(); obj. ; } }

30th Jun 2017, 6:46 AM
Walter Mugo
Walter Mugo - avatar
28 Answers
+ 3
int main() { Sally obj; obj .myPrint() ; }
24th Jun 2019, 2:22 PM
Osama
+ 2
public class A { public void test() { System.out.println("Hi"); } } class B { public static void main(String args[ ]) { A obj = new A(); obj.test() ; } } Sir. This is the answer
1st Jul 2017, 1:12 PM
marvin burboran
marvin burboran - avatar
+ 2
public class A { public void test() { System.out.println("Hi"); } } class B { public static void main(String args[ ]) { A obj = new A(); obj.test() ; } }
6th Jul 2017, 5:52 PM
PREM SHANKAR SINGH
PREM SHANKAR SINGH - avatar
+ 2
Drag and drop from the options below to declare an object of type ''People'', which takes a string as the first parameter for its constructor and a ''Birthday'' object as the second. Declare a ''Birthday'' object 'birthObj' before passing it to ''People's'' constructor. Birthday birthObj(10, 30, 1989); People john("John", birthObj);
31st Jul 2020, 12:08 PM
swapnal mandlik
swapnal mandlik - avatar
+ 1
assist me guys
30th Jun 2017, 6:47 AM
Walter Mugo
Walter Mugo - avatar
+ 1
Drag and drop from the options below to declare an object of class Sally in the main function , and call its myPrint member function using the . (dot) operator. int main() { obj; . ; } Sally class obj myPrint() dot
1st Oct 2018, 7:53 PM
VIDYASAGAR JHA
VIDYASAGAR JHA - avatar
+ 1
assist me plz Drag and drop from the options below to print "Hello".
27th Apr 2019, 2:51 PM
Lulende Mtee Donat
+ 1
Person { public int Age { get; set; } static { Age = 0; } }
7th Jun 2019, 9:06 PM
vikram singh
vikram singh - avatar
+ 1
Hello @Osama answer you is correct
13th Jan 2020, 11:39 AM
Imanuel Wicaksono
Imanuel Wicaksono - avatar
+ 1
4th Feb 2020, 12:09 PM
Lela Dwi Kristianti
Lela Dwi Kristianti - avatar
+ 1
Public Default protected private
29th Mar 2020, 10:47 PM
KABBACH Nafea
0
thanks
3rd Jul 2017, 6:48 AM
Walter Mugo
Walter Mugo - avatar
0
hepsi anlamadim
25th Feb 2018, 4:40 PM
MOMEN OMAR
MOMEN OMAR - avatar
0
answer is class and test
13th Jan 2020, 11:20 AM
Imanuel Wicaksono
Imanuel Wicaksono - avatar
0
answer is class, public and myPrint.
13th Jan 2020, 11:36 AM
Imanuel Wicaksono
Imanuel Wicaksono - avatar
0
Drag and drop from the options below to declare a class ''Sally'', with only a constructor in its public section. answer is class, public, and sally.
14th Jan 2020, 11:53 AM
Imanuel Wicaksono
Imanuel Wicaksono - avatar
0
drag and drop from the options below to declare a class "sally",with only a constructor in its public section. _sally { _: _(); }; Answer: 1. class 2. Public 3. Sally
23rd May 2020, 7:21 PM
Shailesh Kumar meena
Shailesh Kumar meena - avatar
0
try { File f = new File("a.txt"); Scanner sc = new Scanner(f); while (sc.hasNext()) { String a = sc.next(); String b = sc.next(); System.out.println(a + " " + b); } sc.close(); } catch (Exception e) { System.out.println("Error"); } Scanner sc next close
22nd Jun 2020, 4:18 PM
Mohamed Ghenia
Mohamed Ghenia - avatar
0
scanner sc next close
17th Aug 2020, 3:15 PM
kedir.y
kedir.y - avatar
0
class A { public void print() { System.out.println("A"); } } class B { public static void main(String[ ] args) { A object = new A() { @Override public void print() { System.out.println("Hello"); } }; object.print(); } }
6th Sep 2020, 10:47 AM
Khadhraoui Raoua
Khadhraoui Raoua - avatar