Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java public Keyword

/* Code from filename: Main.java
public class Main {
  public String fname = "John";
  public String lname = "Doe";
  public String email = "john@doe.com";
  public int age = 24;
}
*/

class Second {
  public static void main(String[] args) {
    Main myObj = new Main();
    System.out.println("Name: " + myObj.fname + " " + myObj.lname);
    System.out.println("Email: " + myObj.email);
    System.out.println("Age: " + myObj.age);
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: enter a word and print letters java 
Java :: convert code from kotlin to java 
Java :: @Async how it works @EnableAsync 
Java :: madhava kripa 
Java :: java exception handling 
Java :: JAVA Declaration Statements 
Java :: java regex of eauations 
Java :: empty map entry java 
Java :: Develop the Java application called Shapes. For this program, use only for loops and the following print statements below to generate the shapes below: 
Java :: how to find poiwer in java 
Java :: intent- setaction FOR FILES 
Java :: add image in loggin view spring boot security 
Java :: AccountDriver.java 
Java :: java get wrapper class for primitive 
Java :: internal hashcode 
Java :: java returning an comparable array of inorder traversal of binary tree 
Java :: sysout is not working in eclipse 
Java :: sum of number from list 
Java :: java thyemleaf save table form to database 
Java :: java mongodb document get 
Java :: Java Creating LinkedHashSet from Other Collections 
Java :: copy one string to another without using any loops or assignment operator 
Java :: java singleton with synchronized 
Java :: diamonds 
Java :: resources/android/xml/network_security_config.xml 
Java :: android studio press button programmatically 
Java :: ldap java connection 
Java :: Java Change values of variables 
Java :: Write a java program to print a number from the user 
Java :: https://javahungry.blogspot.com/2020/01/list-of-lists-in-java.html 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =