0

Syntax for classes and object

what is the syntax for creating a class and object...and how to access or call it

17th Sep 2017, 3:55 PM
Sanath Srivatsa
Sanath Srivatsa - avatar
3 Antworten
- 2
Class A { public int B() \\ method { } } public Class C { public static void main(string[] args) { \\new creates an object D of class A and A() is a default constructor here. A D = new A(2); \\call method in A through object D. D.B(); } }
17th Sep 2017, 4:04 PM
kanishk goel
kanishk goel - avatar
17th Sep 2017, 4:02 PM
Hatsy Rei
Hatsy Rei - avatar
+ 9
You'll find that in the Java course (chapter Classes And Objects). If you already went through it, try to repeat it. If you have any further or more specific question on the topic - just ask.
17th Sep 2017, 4:01 PM
Tashi N
Tashi N - avatar