answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What does this code return public static int min int x int y?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you code and call a static method?

class MyClass { // Declare a static method to return the square of a number. public static int getSquare(final int n) { return n*n; } public static void main(String[] args) { // Call the static method to find 1522 System.out.println( MyClass.getSquare(152) ); } }


Without array Java code to print prime numbers from 1 to 100?

public class Primes { public static void main(String[] args) { for(int i = 2; i < 100; i++) { if(isPrime(i)) { System.out.println(i); } } } public static boolean isPrime(int n) { if(n 0) return false; } return true; } } }


What is the Java source code for the program which print the prime no series?

public class PrimeNumberPrint {/*** @param args*/public static voidmain(String[] args) {// TODO Auto-generated method stubfor(int i =2; i < 10; i++) {System.out.println(i + " is prime is " + isPrime(i));}}public static booleanisPrime(int n) {int x = n;for(int i=2; i


Source code for LinearSearch in java?

// Returns the index of n in ns or -1 if not found. public static final int linearSearch(final int n, final int[] ns) { for(int i = 0; i &lt; ns.length; ++i) { // If found, return the index if(ns[i] == n) { return i; } } return -1; }


What a java program to find largest and smallest value store in the array?

Implement these methods: public static int smallest(int[] arr) { int small = arr[0]; for(int i = 1; i &lt; arr.size(); i++) if(arr[i] &lt; small) small = arr[i]; return small; } public static int largest(int[] arr) { int large = arr[0]; for(int i = 1; i &lt; arr.size(); i++) if(arr[i] &gt; large) large = arr[i]; return large; }


How you can do prime number program without modules in java?

package javaapplication1; public class JavaApplication1 { public static boolean is_prime(int val){ if (val


Java program to check A is divisible by B?

Implement this method: public static boolean isDivisible(int a, int b) { if(a % b == 0) { return true; } else { return false; } }


Java program for finding GCD and LCM of two given numbers?

These are the two functions you need: public static int lcm(int i1, int i2) { return (i1*i2/gcd(i1,i2)); } public static int gcd(int i1, int i2) { // using Euclid's algorithm int a=i1, b=i2, temp; while (b!=0) { temp=b; b=a%temp; a=temp; } return a; }


Do Fibonacci Series program in dot net?

public static int fib(int n) {return fib(n-1) + fib(n-2);}


Write a program to show the concept of recursion in java?

public class Main{ public static void main(String[] args){ System.out.println("the factorial of 5 is: " + getFactorial(5)); } public static int getFactorial(int num){ return num + getFactorial(num-1); } }


Write a java programm to find maximum number in the given array?

class maximum{public static void main(string...args){System.out.println(max(new int[]{5,3,6,2,4,61}));}static int max(int[]a){int max=0;for(int i=0;imax)max=a[i];}return max;}}


Write algorithm of a largest number and smallest number among three numbers?

public class FindLeastAndGreatest { public static void main(String[] args) { // number can't be equal with each other int a = 7; int b = 7; int c = 6; System.out.println(least(a,b,c)); System.out.println(greatest(a,b,c)); } public static int least(int a, int b, int c) { int least = 0; if(a &lt; b &amp;&amp; a &lt; c) { least = a; } else if(b &lt; a &amp;&amp; b &lt; c) { least = b; } else { least = c;} return least; } public static int greatest(int a, int b, int c) { int greatest = 0; if(a &gt; b &amp;&amp; a &gt; c) { greatest = a; } else if(b &gt; a &amp;&amp; b &gt; c) { greatest = b; } else { greatest = c;} return greatest; } }