Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Static Inner Class

class MotherBoard {
   // static nested class
   static class USB{
       int usb2 = 2;
       int usb3 = 1;
       int getTotalPorts(){
           return usb2 + usb3;
       }
   }

}
public class Main {
   public static void main(String[] args) {
       // create an object of the static nested class
       // using the name of the outer class
       MotherBoard.USB usb = new MotherBoard.USB();
       System.out.println("Total Ports = " + usb.getTotalPorts());
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: speak function in java 
Java :: simple example of adding two number by calling a method 
Java :: show all debug points intellij 
Java :: stack overflow recyclerview 
Java :: get selected text in java 
Java :: sudoku 6x6 java 
Java :: how to check if something exists in an sql column java 
Java :: java cors issue 
Java :: .int x=5; final int y=7; x=x+10; y=y+10; 
Java :: document inserted succesfully but not present in the collection java 
Java :: Java instanceof in Interface 
Java :: set background drawable programmatically android 
Java :: Clicking on Fragment goes through in Activity 
Java :: java declare and populate array 
Java :: how to show the hex detail of a file in java 
Java :: itext new page 
Java :: edit activity main drawer items text color android 
Java :: random years java 
Java :: Android popBackStack to specific fragment 
Java :: activity selection java solution 
Java :: ArrayList go to value jav 
Java :: Java Creating LinkedHashMap from Other Maps 
Java :: Java Target annotations attributes 
Java :: how to get the last vowel of a string in java 
Java :: how to create an abstract class in java 
Java :: Which one of the following values can a Java variable NOT have? 
Java :: Could not find com.commercehub.gradle.plugin:gradle-avro-plugin:0.10.0. 
Java :: Fast Search in java 
Java :: java filter list of dupllicate netries 
Java :: trivers json node as node type2 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =