can we write program without class

Answer Posted / bhargavi rani

no.becoz java is pure object oriented language.so all the
member functions and datamembers must be write inside the
class.here we can also say that class is an example for
encapsulation.encapsulation is binding data and member
functions in a single unit.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you do math powers in java?

818


What is java abstraction with example?

732


Can the garbage collection be forced by any means?

732


How do you remove duplicates from an array in java?

728


what is object slice?

1775


what happens when a thread cannot acquire a lock on an object? : Java thread

824


What is the use of optional ?

807


What is the difference between a window and a frame in java programming?

863


Can we override private method?

826


Which method returns the length of a string?

804


What are some alternatives to inheritance?

835


How many bytes are a float?

713


How do you check if a number is a perfect square?

757


In how many ways we can do exception handling in java?

796


What is the difference between object oriented programming language and object based programming language?

766