Skip to content

Tag Archives: Functions

What is the output of the following code : L = ['a','b','c','d'] print("".join(L)) (A) Error (B) None (C) abcd (D) [‘a’,’b’,’c’,’d’] Answer: (C) Explanation: “”… Read More
What will be the output of the following code : print type(type(int)) (A) type ‘int’ (B) type ‘type’ (C) Error (D) 0 Answer: (B) Explanation:… Read More
Predict the output of the following program. class Test {     public static void main(String[] args)     {         String str = "geeks";         str.toUpperCase();         str += "forgeeks";         String… Read More
Predict the output of the following program. class Test implements Cloneable {     int a;        Test cloning()     {         try         {             return (Test) super.clone();         }         catch(CloneNotSupportedException… Read More
Predict the output of the following program. class Test {        public static void main(String[] args)     {         String obj1 = new String("geeks");         String obj2 =… Read More
Predict the output of the following program. class Test {     public static void main(String[] args)     {         StringBuffer a = new StringBuffer("geeks");         StringBuffer b = new… Read More
Predict the output of the following program. class Test {     public void demo(String str)     {         String[] arr = str.split(";");         for (String s : arr)         {… Read More
Function overloading is a feature of object-oriented programming where two or more functions can have the same name but different parameters. When a function name… Read More
We have discussed Circular Linked List Introduction and Applications, in the previous post on Circular Linked List. In this post, traversal operation is discussed.  Recommended… Read More
#include <stdio.h> #include <stdarg.h> int fun(int n, ...) {     int i, j = 1, val = 0;     va_list p;     va_start(p, n);     for (; j <… Read More
Predict the output? class Main {     public static void main(String args[]) {                 System.out.println(fun());     }        static int fun(int x = 0)     {       return x;     } }… Read More
In Java, can we make functions inline like C++? (A) Yes (B) No Answer: (B) Explanation: Unlike C++, in Java we can’t suggest functions as… Read More
class intWrap {    int x; }  public class Main {      public static void main(String[] args) {        intWrap i = new intWrap();        i.x = 10;        intWrap… Read More
class Test { public static void swap(Integer i, Integer j) {       Integer temp = new Integer(i);       i = j;       j = temp;    }    public static… Read More
public class Main {      public static void main(String args[]) {         String x = null;         giveMeAString(x);         System.out.println(x);      }      static void giveMeAString(String y)      {         y = "GeeksQuiz"; … Read More

Start Your Coding Journey Now!