Try this: (not sure how many changes you have already made)
public class Oops3 { public static void printer(double x, double y) { System.out.println("x = " + x + " and y = " + y); System.out.println("The value from main is: " + y);} public static void main(String[] args) { int z = 5; double y = 867.5309; double x = 10.01; System.out.println("x= " + x + " and y = 8.0"); printer( x,y); System.out.println("z = " + z); }}
Related Posts:
- Python-like list comprehension in Java
- What are the -Xms and -Xmx parameters when starting JVM?
- Does Java support default parameter values?
- Does Java support default parameter values?
- method in class cannot be applied to given types
- HTTP Status 405 – Request method ‘POST’ not supported (Spring MVC)
- Usage of @see in JavaDoc?
- What does .class mean in Java?
- java, get set methods
- What is “String args[]”? parameter in main method Java
- method in class cannot be applied to given types
- HTTP Status 405 – Request method ‘POST’ not supported (Spring MVC)
- Why nextLine() and not nextString() ?
- When is the finalize() method called in Java?
- Error: Main method not found in class Calculate, please define the main method as: public static void main(String[] args) [duplicate]
- How to return a boolean method in java?
- Java methods getting euclidean distance
- How can i fix this equals on primitive type(int)
- Return outside method error
- Class Declarations for temperature program in Java
- Error unable to access jarfile C:\Jar
- In laymans terms, what does ‘static’ mean in Java? [duplicate]
- Sort an array in Java
- Java String Split by “|”
- Could not reserve enough space for object heap
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse
- “Char cannot be dereferenced” error
- Print ArrayList
- Unsupported major.minor version 52.0 [duplicate]
- What is a StringIndexOutOfBoundsException? How can I fix it?
- Non-static variable cannot be referenced from a static context
- How to get an enum value from a string value in Java
- Round a double to 2 decimal places [duplicate]
- Int division: Why is the result of 1/3 == 0?
- Given final block not properly padded
- What is Parse/parsing?
- Returning Arrays in Java
- java.lang.ClassCastException
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘MyController’:
- Can I multiply strings in Java to repeat sequences?
- Why does cache use Most Recently Used (MRU) algorithm as evict policy?
- javac not working in windows command prompt
- Java returns error “Cannot instantiate the type”
- HashMap get/put complexity
- @Autowired – No qualifying bean of type found for dependency
- SSH library for Java
- Java ArrayList replace at specific index
- Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
- What is the best math library to use with java?
- How to execute a https GET request from java
- Converting JSON to XML in Java
- Import a custom class in Java
- Default keystore file does not exist?
- The declared package does not match the expected package “”
- Sort a Map
by values - Is not an enclosing class Java
- FtpClient storeFile always return False
- Variable is accessed within inner class. Needs to be declared final
- Using NotNull Annotation in method argument
- How to implement infinity in Java?
- Java Does Not Equal (!=) Not Working?
- How to represent empty char in Java Character class
- Definition of a Java Container
- ‘Source code does not match the bytecode’ when debugging on a device
- How to fix the compiler error in this program?
- “The public type <
> must be defined in its own file” error in Eclipse [duplicate] - How to calculate the intersection of two sets?
- method does not override method in its superclass
- Adding a timer to my program (javafx)
- How to resolve “Syntax error on token “else”” in Java?
- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 exception
- What does this expression language ${pageContext.request.contextPath} exactly do in JSP EL?
- How to determine an object’s class?
- Division of integers in Java
- Consider this code: “int s = 20; int t = s++ + –s;”. What are the values of s and t?
- Reading a .txt file using Scanner class in Java
- “\b” in Java – Windows implemented
- Error: package or namespace load failed for ‘rJava’
- Difference between regex [A-z] and [a-zA-Z]
- How can I convert a char to CharSequence?
- Problems Generating A Math.random Number, Either 0 or 1
- Downloading a file from spring controllers
- Java Error Exception in thread “AWT-EventQueue-0” java.lang.StackOverflowError
- Write a program that reads an unspecified number of integers, determines pos, neg, total, average
- Parsing JSON string in Java
- java attempting to assign weaker access privilege error
- Getting a “no interface expected here” when I try to subclass ServiceConnection [duplicate]
- How to determine day of week by passing specific date?
- Can an int be null in Java?
- What’s the difference between HashSet and Set?
- Netbeans – Error: Could not find or load main class
- Eclipse IDE – Error: Build path specifies execution environment Java SE 1.7
- Why int[] a = new int[1] instead of just int a?
- ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”
- Java Swing setting JPanel Size
- how to use “tab space” while writing in text file
- Change Name of Import in Java, or import two classes with the same name
- set background color: Android
- Class JavaLaunchHelper is implemented in two places
- No Main class found in NetBeans