Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions QuestionForJava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,27 @@ class factorial
System.out.print("fact"+fact);
}
}

-----------
Q1:How to print the data on console?
Answer: Through System.out.print("Printing the data on console");

Q2:What is Class in Java?
Answer: It is a blueprint or a prototype through which objects are made.

Q3:If We have a class named as Work with default constructor then how we will
create the object?
Answer: Work obj = new Work();

Q4:What is Objects in Java?
Answer: It is an instance of class which is used to describe the state and behavior.

Q5: Create an Integer Variable ?
Answer: int var;

Q6: Write any String class function down here?
Ans: String s = "Using string function";
System.out.println(s.length());

Q7: How many classes we can extends in java?
Ans: Since Java does not support multiple inheritance so it's only 1.