Wednesday 29 January 2020

Can I use calloc and malloc as variable name in Java?

Since calloc and malloc are not any java keywords, you can use these as variable names in Java.

App.java
package com.sample.app;

public class App {

 public static void main(String args[]) {

  long calloc = 1l;
  long malloc = 2l;

  System.out.println("calloc : " + calloc);
  System.out.println("malloc : " + malloc);
 }

}

Output
calloc : 1
malloc : 2



You may like

No comments:

Post a Comment