How do i know the difference between a construction and a method?

first a constructor has the same name as the class itself, methods do not. second, a constructor is used to instantiate an object, using the

new

keyword, a method does not necessarily instantiate an object. Also a method always specifies a return type, either void(nothing) or double, int, String, etc; a constructor doest not specify a return type.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.