Question:
Java Programming?
Okashii
2014-12-04 02:22:33 UTC
public class Mini {
public static void main (String[] args){
int a=4;
int b=3;
int c=4;
public static int minimum(int a,int b, int c){
return Math.min(a, Math.min(b, c));
}
}
}
what am i doing wrong?
Eight answers:
brilliant_moves
2014-12-04 02:46:15 UTC
This is how it should be:



public class Mini {

public static void main (String[] args){

int a=4;

int b=3;

int c=4;

System.out.println("Minimum = "+minimum(a, b, c));

} // main()



public static int minimum(int a,int b, int c){

return Math.min(a, Math.min(b, c));

} // minimum()

} // class Mini
Mahmuda Keya
2014-12-21 01:02:59 UTC
Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model.

JAVA PROGRAM :



class box

{

double width;

double height;

double depth;

}

// This class declares an object of type Box //

class BoxDemo

{

public static void main()

{

Box mybox = new Box();

double vol;

// assign values to mybox`s instance variable //

mybox.width=10;

mybox.height=15;

mybox.depth=5;

// compute volume of box //

vol=mybox.width*mybox.height*mybox.depth;

System.out.println(vol);

}

}

Visit"c programming" blog
?
2014-12-04 03:23:46 UTC
Java program code consists of instructions which will be executed on your computer system to perform a task as an example say arrange given integers in ascending order. This page contains examples for beginners to understand how to use java programming for beginners to write simple Java programs. These codes demonstrate how to get input from user, working with loops, strings and arrays.
allan
2014-12-04 22:30:28 UTC
Java program code consists of instructions which will be executed on your computer system to perform a task as an example say arrange given integers in ascending order.

Java programming software: To compile and run Java program code you need to download JDK (Java Development Kit).
Rowan
2014-12-04 02:27:03 UTC
Try not having your minimum function declared inside the main. You also probably want to instantiate it in the main, and use the return value to output it to the screen.
2014-12-04 03:07:38 UTC
"Java language" redirects here. For the natural language from the Indonesian island of Java, see Javanese language.

Not to be confused with JavaScript.

Page protected with pending changes level 1

Java

Java logo and wordmark.svg

Paradigm(s) multi-paradigm: object-oriented, structured, imperative, functional, generic, reflective, concurrent

Designed by James Gosling and

Sun Microsystems

Developer Oracle Corporation

Appeared in 1995[1]

Stable release Java Standard Edition 8 Update 25 (1.8.0_25) / October 14, 2014; 50 days ago

Typing discipline Static, strong, safe, nominative, manifest

Major implementations OpenJDK, GNU Compiler for Java(gcj), many others

Dialects Generic Java, Pizza

Influenced by Ada 83, C++, C#,[2] Eiffel,[3] Generic Java, Mesa,[4] Modula-3,[5] Oberon,[6] Objective-C,[7] UCSD Pascal,[8][9] Smalltalk

Influenced Ada 2005, BeanShell, C#, Clojure, D, ECMAScript, Groovy, J#, JavaScript, Kotlin, PHP, Python, Scala, Seed7, Vala

Implementation language C and C++

OS Cross-platform (multi-platform)

License GNU General Public License, Java Community Process

Filename extension(s) .java , .class, .jar

Website For Java Developers

Java Programming at Wikibooks

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[10] and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA),[11] meaning that code that runs on one platform does not need to be recompiled to run on another.[12] Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is, as of 2014, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers.[13][14] Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.



The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licences. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).
?
2014-12-05 12:24:19 UTC
"return" does not mean "print."



You need main to call minimum(a,b,c) and then print the result.
John
2014-12-04 02:31:44 UTC
what's wrong? do you count stealing other code without giving credit. you want other to help you again.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...