Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

what will be the output of the following java program? class variable_scope { public static void main(string args[]) { int x; x = 5; { int y = 6; system.out.print(x + " " + y); } system.out.println(x + " " + y); } }

CompSciGeek answered on June 7, 2022 Popularity 7/10 Helpfulness 1/10

Contents


More Related Answers

  • Java print class type
  • print int in java
  • print out value java
  • public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); } }
  • How to Use the println() Function in Java
  • public class MyClass { public static void main(String args[]) { int x=10; int y=25; int z=x+y; System.out.println("Sum of x+y = " + z); } kkk }
  • What will be the output of the following Java program?
  • public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } }
  • public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } }
  • public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } }
  • public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } }
  • public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } }
  • int a[ ]={4,8,3,2}; a[0] = 23; a[3]= a[1]; a[2]=12; for(int i=0; i<a.length; i++) System.out.println(a[i]);
  • Predict the output of the given code: void method2(char c) { System.out.println( (int) c); } What will be the output of the given code snippet if i) if 'x' is passed to c i) if ‘0’ is passed to c
  • public class App{ public static void main(string [] args){ System.out.println(" /|"); System.out.println(" / |"); System.out.println(" / |"); System.out.println("/___|"); } }
  • Give the output of the following code: int a = 10; int b = 20; String s = Integer.toString(a); String t = Integer.toString(b); System.out.println((s+t));
  • public class ForLoop { public static void main(String[] args){ for(int i=1; i=n ;i++ ) System.out.println("i"); } }
  • public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); } }
  • public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); } }
  • public class HelloWorld { public static void main( String[] argv ) { int a=4%2*3-1/0; System.out.println(a); } }
  • public class HelloWorld { public static void main( String[] argv ) { int a=4%2*3-1/0; System.out.println(a); } }
  • class c { public static void main(string[] args){ system.out.println("hello"+args[0]);}} output
  • public class MyClass { public static void main(String[] args) { System.out.println("Hello World"); } }
  • import java.util.Scanner; public class MyClass { public static void main(String args[]) { int ProductPrice; int ShippingFee; int sum; //input codes here: System.out.println("Sender: Dan Daniel C. Gica");
  • When will integers be added and when will they just be printed in a Java print statement?
  • class a { int data = 5; a() { data = 10; } } public class test { public static void main(string args[]) { a obj = new a(); system.out.println(obj.data); } }
  • What is the use of the PrintStream class in Java IO?
  • Java Program to Demonstrate Working of valueOf() Method
  • class Example{ public static void main(String args[]){ System.out.println("Institute of Computer Technology"); } }

  • what will be the output of the following java program? class variable_scope { public static void main(string args[]) { int x; x = 5; { int y = 6; system.out.print(x + " " + y); } system.out.println(x + " " + y); } }

    -1
    Popularity 7/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Jun 07 2022
    CompSciGeek
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.