- 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. ; } }
28 Respostas
+ 3
int main() {
Sally obj;
obj .myPrint() ;
}
+ 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
+ 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() ;
}
}
+ 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);
+ 1
assist me guys
+ 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
+ 1
assist me plz Drag and drop from the options below to print "Hello".
+ 1
Person {
public int Age { get; set; }
static {
Age = 0;
}
}
+ 1
Hello @Osama answer you is correct
+ 1
+ 1
Public
Default
protected
private
0
thanks
0
hepsi anlamadim
0
answer is class and test
0
answer is class, public and myPrint.
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.
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
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
0
scanner
sc
next
close
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();
}
}