Get Job-ready: Java Course with 45+ Real-time Projects! - Learn Java
Buckle up, Java warriors! It’s time to unleash your inner coder and put your method mastery to the test. This comprehensive quiz is designed to be a challenging yet rewarding journey through the fundamentals of Java methods.
Whether you’re a seasoned veteran with years of experience or a fresh-faced programmer just starting your Java odyssey, this quiz is the perfect tool to sharpen your skills and solidify your understanding.
Dive deep into the world of methods, tackle a variety of questions, and identify areas where your knowledge can truly shine. Not only will you gain valuable insights into your strengths and weaknesses, but you’ll also have the opportunity to reinforce core concepts and emerge a more confident Java developer.
So, are you ready to answer the call? Take the quiz, embrace the challenge, and watch your method mastery level up! Let’s test your knowledge.
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
-
Question 1 of 15
1. Question
class MethodSample {
void addition(int a , int b) {
System.out.println( a + b );
}
void subtraction (int a , int b) {
System.out.println(a-b);
}
void multiplication(int a , int b){
System.out.println(a*b);
}
public static void main ( String args [ ] )
{
addition(3,4);
subtraction(5,2);
}
}
CorrectIncorrect -
Question 2 of 15
2. Question
class Methods {
void inputMethod ( ) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
}
void display ( ) {
System.out.println(“The Given Number is “ + a );
}
public static void main ( String args [ ] )
{
*****;
*****;
}
}
CorrectIncorrect -
Question 3 of 15
3. Question
class First {
void method ( ) {
System.out.println(“DataFlair”);
}
};
public class Second {
public static void main ( String args [ ] )
{
Second object = new object();
object.method():
}
}
CorrectIncorrect -
Question 4 of 15
4. Question
class MethodsSample {
void text ( String a , int b ) {
System.out.println ( a + b );
}
public static void main ( String args [ ] )
{
text ( 1 , “ DataFlair “ );
}
}
CorrectIncorrect -
Question 5 of 15
5. Question
class Example {
void sampleMethod ( String text) {
System.out.println(text);
}
public static void main ( String args [ ] ) {
sampleMethod(“DataFlair”);
sampleMethod(“DataFlair”);
sampleMethod(“DataFlair”);
}
}
CorrectIncorrect -
Question 6 of 15
6. Question
class Sample {
int addition ( float x , float y ) {
return x + y ;
}
};
class Main {
public static void main ( String args [ ] )
{
System.out.println(addition ( 32.8 , 7.2 ));
}
}
CorrectIncorrect -
Question 7 of 15
7. Question
class Methods {
int multiplication ( int a , int b , int c ) {
c = a * b ;
}
public static void main ( String args [ ] )
{
System.out.println(multiplication(3,5));
}
}
CorrectIncorrect -
Question 8 of 15
8. Question
Which of these is the way for method Overloading ?
CorrectIncorrect -
Question 9 of 15
9. Question
class MethodOverloading {
void addition( String a , String b ) {
System.out.println(a + b );
}
static int addition ( int a , int b ) {
return a + b;
}
};
class MainFunction {
public static void main ( String args [ ] )
{
addition(“Data”, “Flair”);
system.out.println(addition(1,2));
}
}
CorrectIncorrect -
Question 10 of 15
10. Question
class MethodOverloading {
static int addition ( int a , int b ) {
return a + b ;
}
void addition ( int a , int b , int c ) {
return a + b + c ;
}
public static void main ( String args [ ] )
{
system.out.println(addition(1,2,3);
}
};
CorrectIncorrect -
Question 11 of 15
11. Question
class Exception {
void _first( ) {
System.out.println(“Method is executed”);
}
public static void main ( String args [ ] )
{
_first();
}
}
CorrectIncorrect -
Question 12 of 15
12. Question
class Sample {
void display ( ) {
int a;
system.out.println(a);
}
public static void main ( String args [ ] )
{
display();
}
}
CorrectIncorrect -
Question 13 of 15
13. Question
Which of the following in Java does not return a value inside a method ?
CorrectIncorrect -
Question 14 of 15
14. Question
class MethodSample {
void radius ( int d ) {
system.out.println(d/2);
}
int area ( float r ) {
return 3.14*r*r;
}
public static void main ( String args [ ] )
{
System.out.println(radius(10) + area(radius(10));
}
}
CorrectIncorrect -
Question 15 of 15
15. Question
Which of the following is not a true statement about methods in Java programming ?
CorrectIncorrect
Summary:
Embark on a journey of self-discovery through a series of meticulously crafted questions designed to delve deep into your understanding of method creation, utilization, and problem-solving techniques. By actively engaging with these challenges, you’ll not only solidify your grasp of existing Java knowledge but also uncover areas where your skills can truly flourish.
Consider this quiz a stepping stone on your path to Java mastery – a chance to identify knowledge gaps, build a robust foundation, and ultimately achieve programming proficiency. So, are you ready to put your skills to the test? Dive in and prepare to be surprised by your potential!!
